You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Roberto <rm...@montefiore.ch> on 2004/11/14 16:13:23 UTC

MySQL Database connection

Hiya all,
I got a problem connection with my MySQL database. I guess I did the right stuff, I mean in the web.xml file I added this:

    <init-param>
      <param-name>load-class</param-name>
      <param-value>
        <!-- For MySQL on localhost -->
        org.gjt.mm.mysql.Driver

        <!-- For JDBC-ODBC Bridge: -->
        sun.jdbc.odbc.JdbcOdbcDriver
      </param-value>
    </init-param>

then in the cocoon.xconf I added this

    <jdbc logger="core.datasources.mysql_pool" name="mysql_pool">
      <pool-controller min="5" max="10">
      <dburl>jdbc:mysql:://<dblocation>/<databaseName></dburl>
      <user>roberto</user>
      <password/>
    </jdbc>

If I let the things like that the log file tell me:
ERROR   (2004-11-14) 15:54.31:820   [sitemap.transformer.sql] (/montefiore/hellococoon) PoolThread-3/SQLTransformer.Query: Could not use connection: mysql_pool org.apache.avalon.framework.service.ServiceException: datasources: ComponentSelector could not find the component for hint [mysql_pool] (key [mysql_pool]) (Key='org.apache.avalon.excalibur.datasource.DataSourceComponentSelector/mysql_pool')

Seems he can't find the component & maybe it got right (sure it got...), so what I did is try to change the name like that:

    <jdbclogger="core.datasources.personnel" name="personnel">
      <pool-controller min="5" max="10">
      <dburl>jdbc:mysql:://<dblocation>/<databaseName></dburl>
      <user>roberto</user>
      <password/>
    </jdbc>

personnel is the standard name of the Cocoon database (jdbc:hsqldb:hsql://localhost:9002) I guess.. infact the log error file in this case tell me that he can't find the table that Im looking for, of course the connection is with another database that dosnt' have my table...

So my question is, where I can define a logger & a name for the mysql database & how I can set it properly?

Thanx in advance for any suggestion.
Ciao
Roberto



Re: MySQL Database connection

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Roberto wrote:
> Hiya all,
> I got a problem connection with my MySQL database. I guess I did the 
> right stuff, I mean in the web.xml file I added this:
>  
>     <init-param>
>       <param-name>load-class</param-name>
>       <param-value>
>         <!-- For MySQL on localhost -->
>         org.gjt.mm.mysql.Driver
>  
>         <!-- For JDBC-ODBC Bridge: -->
>         sun.jdbc.odbc.JdbcOdbcDriver
>       </param-value>
>     </init-param>
>  
> then in the cocoon.xconf I added this
>  
>     <jdbc logger="core.datasources.mysql_pool" name="mysql_pool">
>       <pool-controller min="5" max="10">
>       <dburl>jdbc:mysql:://</dblocation/>/</databaseName/></dburl>
>       <user>roberto</user>
>       <password/>
>     </jdbc>
RU sure you added it under datasources element? If so try browsing the 
logs for ClassNotFoundException. Maybe you mispelled the driver name or 
put the jar in improper place.


-- 
Leszek Gawron                                      lgawron@mobilebox.pl
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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