cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sheraz Khan <Sheraz.K...@Valorious.com>
Subject Re: simple connection to MySQL
Date Sat, 07 Sep 2002 11:03:56 GMT
hey dude

u need to place the mysql driver called "mm.mysql-2.0.11-bin.jar" which  
has to then be placed in your applications "WEB-INF/lib/" dir.


Then U have to declare your RDBMS datasource, which u have done, and  
matches with mine..
but i have also added a password.

then...

You need to declare your JDBC driver, for the RDBMS.

this is done in the Load-class <init-param> section of the deployment  
discriptor web.xml file
o yeh not that the driver name is not the same as the driver file  
name!!!!!

type the following

<init-param>
<param-name>load-class</param-name>
<param-value>
org.gjt.mm.mysql.Driver <!-- this the driver name -->
</param-value></init-param>


hope this helps

got more info at my web site

http://cocoon.sherazkhan.com

take care





On Friday, September 6, 2002, at 06:18 PM, Alan Hodgkinson wrote:

>
> Dear Vaskin
>
>> I've tried to follow the how-to's and tutorials on the net and in the
>> docs.
>
> Yup.. I tried that to and basically, everything went wrong!
>
>> Someone plase let me know what step I'm missing:
>
> There are a few things to check:
>
>> 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
>
> Sounds ok.
>
>> 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
>
> Zip of the mysql driver.. sounds suspicious. See check step below.
>
>> 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>
>
> You dburl looks suspicious. Mine looked like:
>
>        <dburl>jdbc:mysql://localhost:3306/mydb</dburl>
>
> Where 3306 is mysql's server port number and 'mydb' is the database
> name.
>
> See below for how to check 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
>>
>>          <!-- For parent ComponentManager sample:
>>          org.apache.cocoon.samples.parentcm.Configurator
>>          -->
>>        </param-value>
>>      </init-param>
>
> Check the logs to see if the driver even got loaded. The driver
> class name looks suspicious. Mine was:
>
>   org.gjt.mm.mysql.Driver
>
> Look in the logs for 'Could not force-load class' (or just 'mysql').
>
> Did you install the driver jar file in WEB-INF/lib?
>
> I got my driver from:
>
>
> http://prdownloads.sourceforge.net/mmmysql/mm.mysql-2.0.14-you-must- 
> unjar-me.jar
>
> Unjar the file and follow the instructions.
>
>> 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
>
> Try to access the database using your dburl and the hsqldb Java GUI.
>
> Try this:
>
>   cd $TOMCATA_HOME/webapps/cocoon
>   java -cp WEB-INF/lib/hsqldb-1.61.jar org.hsqldb.util.DatabaseManager
>
> This starts a GUI based DB management application.
>
> Set the driver type to "HSQL Database Engine Server"
>
> Then set the following:
>
>   Driver:       org.gjt.mm.mysql.Driver
>   URL:          jdbc:mysql://localhost:3306/personnel (or whatever)
>   User:         myuser
>   Password:     mypassword
>
> If this lets you in, then your URL, user name and password is probably
> ok, and you have to start looking in the cocoon logs.
>
> If this doesn't work then don't waste time with the Coocoon config  
> until
> you can get this step to work. BTW: this is a handy app for looking at
> your DB.
>
> You may also have permissions problems. See: The MySQL documentation:
> Section: '4.2.10 Causes of Access denied Errors'. Basically you may  
> have
> to grant permissions on your database.
>
>> Any help would be appreciated.
>
> Good luck,
>
> Alan Hodgkinson.
>
> ---------------------------------------------------------------------
> 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