cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bert Van Kets <b...@vankets.com>
Subject Re: Cocoon 2 + Access
Date Thu, 16 May 2002 08:16:51 GMT
This is a very good suggestion and will proof that Java and Access don't mix.
BTDT
The best solution for this problem I have found (been given) is the use of 
DBTools on top of MySQL.  Install MySQL locally and add DBTools 
(www.dbtools.com.br).  This gives you an interface with all the Access like 
database access.  You an even import your Access database (data and/or 
structure).
Get MySQL on mysql.org.  You can find some JDBC drivers there too.

Don't use ODBC in combination with JDBC.  ODBC is written in C or C++ and 
is a bad combination with Java, performance wise.

This is my € 0.02 worth of advice ;-).
Bert

At 09:02 16/05/2002 +0200, you wrote:
>Cyril,
>
>May I add a suggestion? Perhaps you should first try to make a DB 
>connection from within a simple scratch program (so just in a main() 
>method of some scratch class). I have the impression that the main part of 
>the issues you're having, lies there. Once you have it in scratch code, it 
>will be fairly easy to copy&paste it into an XSP page.
>
>hth,
>tomK
>
>
>
>Faulkner, Perry wrote:
>
>>Cyril,
>>
>>You probably should set up a datasource, using the ODBC data manager. 
>>That's what the logs part 'jdbc:odbc:logs' is referring to in your 
>><dburl> tag. Use the data source manager to create a data source, 'logs' 
>>that refers to your access database 'C:....\JAVA\JDBC\logs.mdb'.
>>
>>When you execute, check the cocoon logs, 
>>TOMCAT\webapps\cocoon\web-inf\logs to see what problems are occuring, if 
>>any! Also enable tracing in the ODBC data source manager to see if your 
>>queries are being passed to ODBC.
>>
>>Perry
>>
>>     -----Original Message-----
>>     *From:* cyril vidal [mailto:cyr.vidal@wanadoo.fr]
>>     *Sent:* Thursday, 16 May 2002 9:20
>>     *To:* cocoon-users@xml.apache.org
>>     *Subject:* Re: Cocoon 2 + Access
>>
>>     Hi Perry,
>>
>>     I've tried with // instead  of / ,it isn't better...
>>     Anyway, I've configurated with esql and pool.
>>     the cocoon.xconf looks like this:
>>
>>     <jdbc name="pool">
>>
>>     <pool-controller min="5" max="10"/>
>>
>>     <dburl>jdbc:odbc:logs</dburl>  (with odbc, we don't need to write
>>     the complete url, right??)
>>
>>     <user></user>
>>
>>     <password></password>
>>
>>     </jdbc>
>>
>>     and I didn't forget to load the driver in web.xml...
>>
>>
>>
>>     My file base1.xsp is this one, as simple as possible, just to test
>>     the connection
>>
>>     <?xml version="1.0" encoding="iso-8859-1"?>
>>     <xsp:page language="java"
>>               xmlns:xsp="http://apache.org/xsp">
>>               xmlns:esql="http://apache.org/cocoon/SQL/v2">
>>
>>     <doc>
>>        <esql:connection>
>>          <esql:pool>pool</esql:pool>
>>        </esql:connection>
>>     </doc>
>>
>>
>>     </xsp:page>
>>
>>
>>
>>     To my great surprise, when I execute this file, I obtain:
>>
>>     <doc xmlns:xsp="http://apache.org/xsp">
>>
>>     <connection>
>>
>>     <pool>pool</pool>
>>
>>     </connection>
>>
>>     </doc>
>>
>>     I think, it's not normal...I should not see the connection
>>     element...  I think I have to change the line
>>     <dburl>jdbc:odbc:logs</dburl> but I don't know really how to do...
>>
>>     regards,
>>
>>     Cyril.
>>
>>
>>
>>         ----- Original Message -----
>>         *From:* Faulkner, Perry <mailto:Perry.Faulkner@det.nsw.edu.au>
>>         *To:* 'cocoon-users@xml.apache.org'
>>         <mailto:%27cocoon-users@xml.apache.org%27>
>>         *Sent:* Thursday, May 16, 2002 12:47 AM
>>         *Subject:* RE: Cocoon 2 + Access
>>
>>         Hi Cyril,
>>
>>         In theory it should work, as it's just some Java code, similar
>>         to that produced by ESQL. The disadvantage, is that you don't
>>         have any error checking or logging to fall back on when
>>         situations like this occur, and ESQL would provide that.
>>
>>         Anyway, the only obvious thing that I can see, is to put \\'s
>>         <file://%5C%5C%27s> in your connection string, e.g:
>>
>>         ("jdbc:odbc:localhost:8080/c:\\Mes_documents\\JAVA\\JDBC\\logs");
>>
>>         Also turn on ODBC tracing and see if any other information is
>>         logged, to help you resolve the problem.
>>
>>         Perry
>>
>>
>>             -----Original Message-----
>>             *From:* cyril vidal [mailto:cyr.vidal@wanadoo.fr]
>>             *Sent:* Thursday, 16 May 2002 8:18
>>             *To:* cocoon-users@xml.apache.org
>>             *Subject:* Cocoon 2 + Access
>>
>>             Hy!
>>
>>             I would like to know  if it is an obligation to use ESQL
>>             and the connection pool provided by Cocoon2 to connect to
>>             a database.
>>             By example, isn't it possible just to write the following
>>             code, by which a simply connection should be executed with
>>             the 'logs' database?
>>             I've tried it and it doesn't work but I don't know if
>>             there's an error on the code or if anyway, it could never run.
>>             Some of you can help me, please?
>>             Thanks in advance,
>>             Cyril.
>>
>>             <?xml version="1.0" encoding="iso-8859-1"?>
>>             <xsp:page language="java"
>>                       xmlns:xsp="http://apache.org/xsp">
>>
>>             <xsp:structure>
>>             <xsp:include>java.sql*</xsp:include>
>>             </xsp:structure>
>>
>>             <Promotion auteur="Jules">
>>
>>             <xsp:logic>
>>             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>>             Connection conn =
>> 
>>DriverManager.getConnection("jdbc:odbc:localhost:8080/c:\Mes_documents\JAVA\JDBC\logs");
>>             Statement stmt = conn.createStatement();
>>             ResultSet resultat = stmt.executeQuery("select * from
>>             visit where userid='cyril'");
>>             </xsp:logic>
>>
>>             <Description>Nous proposons une réduction de 25%,
>>             restreinte à la période de Septembre 20001 à OCtobre
>>             20001</Description>
>>
>>             <row>
>>             <userid><xsp:expr>resultat.getString (1)</xsp:expr></userid>
>>             <sessionid><xsp:expr>resultat.getString
>>             (2)</xsp:expr></sessionid>
>>             <visitdate><xsp:expr>resultat.getString
>>             (3)</xsp:expr></visitdate>
>>             <referrer><xsp:expr>resultat.getString
>>             (4)</xsp:expr></referrer>
>>             <page><xsp:expr>resultat.getString (5)</xsp:expr></page>
>>             </row>
>>
>>             </Promotion>
>>             </xsp:page>
>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message