cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Watson" <c.wat...@zen.co.uk>
Subject RE: simple connection to MySQL
Date Sat, 07 Sep 2002 12:01:55 GMT
Vaskin

I'm guessing (from the class name in your web.xml) you've just downloaded
the new Connector/J from www.mysql.com ??
In which case ...

See my annotations below

> -----Original Message-----
> From: Vaskin Kissoyan [mailto:vkissoyan@lokion.com]
> Sent: 06 September 2002 16:22
> To: cocoon-users@xml.apache.org
> Subject: simple connection to MySQL
>
>
> I've tried to follow the how-to's and tutorials on the net and in the
> docs. Someone plase let me know what step I'm missing:
>
> 0)
> * Built 2.0.3 with all the samples and libs, installed war file under
> Tomcat 4.04, under JDK 1.4
> * Built same tables with given sql file in mysql on a default install of
> 3.23.51 on same machine (localhost), database is cocoon
>
>
> 1) Dropped the zip file into appropriate place:
> * tried both as zip and renamed to jar
> * tried in server\lib and also cocoon\WEB-INF\lib

The file you need to take out of the zip and put in cocoon\WEB-INF\lib is
mysql-connector-java-2.0.14-bin.jar

>
> 2) Added the following to cocoon.xconf inside <datasources/> under the
> default built in element <jdbc name="personnel"/>
>      <jdbc name="mypool">
>       <pool-controller min="1" max="5"/>
>       <dburl>jdbc:mysql://localhost/cocoon</dburl>
>       <user>root</user>
>       <password/>
>      </jdbc>
>

Try       <dburl>jdbc:mysql://localhost:3306/cocoon</dburl>
where cocoon is whatever you've called your mysql database
3306 is the port number used by mysql, and I don't think the driver defaults
to use 3306 - you have to tell it

> 4) Added the load-class in cocoon's web.xml as follows
>      <init-param>
>        <param-name>load-class</param-name>
>        <param-value>
>          <!-- For IBM WebSphere:
>          com.ibm.servlet.classloader.Handler -->
>
>          <!-- For Database Driver: -->
>          org.hsqldb.jdbcDriver
> 	com.mysql.jdbc.Driver

That's right for the new Connector/J

(The old Mark Matthews JDBC library - from wich Connector/J was derived -
used a class name org.gjt.mm.mysql.Driver, which is what some other people
who've replied to you are referring to.)

>
>          <!-- For parent ComponentManager sample:
>          org.apache.cocoon.samples.parentcm.Configurator
>          -->
>        </param-value>
>      </init-param>
>
> 4) Getting the following error:
> org.apache.cocoon.ProcessingException: Exception in
> ServerPagesGenerator.generate(): java.lang.RuntimeException: Could not
> get the datasource java.sql.SQLException: No suitable driver
>
> When I try to pull up the ESQL sample

Have you changed the ESQL sample to use YOUR pool, which, from the above,
you've called "mypool" ?
You'll also need to have populated your mysql database, which, from the
above, you've called cocoon ...

>
> Any help would be appreciated.
>

I've tried. Hope it works!

Christopher Watson

>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.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