cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <>
Subject Re: jdbc problem in a custom generator
Date Tue, 07 Dec 2004 13:38:44 GMT
Il giorno 07/dic/04, alle 14:03, Nicolas Rod ha scritto:

> I'm quite new to cocoon and I'm trying to make a jdbc connection in a 
> custom generator but I always get this error which can be found in the 
> sitemap.log: 'java.sql.SQLException: No suitable driver'
> Here's the code I use in my generator:
>    Class.forName("oracle.jdbc.driver.OracleDriver");
>    Connection conn = DriverManager.getConnection(url, username, 
> password);
> I also tried with:
>    DriverManager.registerDriver (new 
> oracle.jdbc.driver.OracleDriver());
>    Connection conn = DriverManager.getConnection(url, username, 
> password);
> Both codes give me the same error.

Your code looks fine to me. Are you sure you are using the right kind 
of url? It should be something like 

> The driver class is loaded in the web.xml, as I know it has to be.

It does not have to be, if you are loading the driver by yourself, like 
in the above code. It has to be only if you declare a datasource 
component in cocoon.xconf, which does not seem to be your case.


Ugo Cei -

View raw message