On the end I managed to open datasource, it was stupd spelling mistake,
but I was too tired to see it.

Thanx all for answering.



-----Original Message-----
From: Sean Dockery [mailto:[EMAIL PROTECTED]] 
Sent: Friday, February 07, 2003 03:16 
To: Tomcat Users List
Subject: RE: Cannot load JDBC driver class 'null' , again

So, when you execute the following command...

jar -tf HSQLDB.jar

...you see the line...

org/hsqldb/jdbcDriver.class

...Correct?

Odd naming convention for a class--having jdbc in jdbcDriver in lower
case...

Have you attempted connecting to the database without using DBCP?  That
is, 
trying...

<snip>
Class.forName("org.hsqldb.jdbcDriver");

String url = "jdbc:hsqldb:hsql://asterix";
String username = "iuser";
String password = "iuser";

Connection conn = DriverManager.getConnection(url, username, password);

if(conn != null)
   out.println("Success.");
else
   out.println("Failure.");
</snip>



At 17:31 2003-02-06 +0100, you wrote:
>Yes,
>HSQLDB.jar
>
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, February 06, 2003 17:25
>To: [EMAIL PROTECTED]
>Subject: RE: Cannot load JDBC driver class 'null' , again
>
>Is your jdbc driver in jar file?
>
>Regards,
>
>
>PQ
>
>"This Guy Thinks He Knows Everything"
>"This Guy Thinks He Knows What He Is Doing"
>
>-----Original Message-----
>From: Uros Kotnik [mailto:[EMAIL PROTECTED]]
>Sent: February 6, 2003 11:24 AM
>To: [EMAIL PROTECTED]
>Subject: Cannot load JDBC driver class 'null' , again
>
>Hi,
>
>This question was probbably posted many times but I didn't found answer
>and I really need it.
>
>I'm using TC 4.1
>DB : Hypersonic
>HSQLDB.jar in \tomcat_home\common\lib
>
>Server.xml
>----------
>
><Context path="/DBTest" docBase="DBTest"
>        debug="5" reloadable="true" crossContext="true">
>
>
>   <Logger className="org.apache.catalina.logger.FileLogger"
>              prefix="localhost_DBTest_log." suffix=".txt"
>              timestamp="true"/>
>
>   <Resource name="jdbc/TestDB"
>                auth="Container"
>                type="javax.sql.DataSource"/>
>
>   <ResourceParams name="jdbc/TestDB">
>     <parameter>
>       <name>factory</name>
>       <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>     </parameter>
>
>     <!-- Maximum number of dB connections in pool. Make sure you
>          configure your mysqld max_connections large enough to handle
>          all of your db connections. Set to 0 for no limit.
>          -->
>     <parameter>
>       <name>maxActive</name>
>       <value>100</value>
>     </parameter>
>
>     <!-- Maximum number of idle dB connections to retain in pool.
>          Set to 0 for no limit.
>          -->
>     <parameter>
>       <name>maxIdle</name>
>       <value>30</value>
>     </parameter>
>
>     <!-- Maximum time to wait for a dB connection to become available
>          in ms, in this example 10 seconds. An Exception is thrown if
>          this timeout is exceeded.  Set to -1 to wait indefinitely.
>          -->
>     <parameter>
>       <name>maxWait</name>
>       <value>10000</value>
>     </parameter>
>
>     <!-- username and password for dB connections  -->
>     <parameter>
>      <name>username</name>
>      <value>iuser</value>
>     </parameter>
>     <parameter>
>      <name>password</name>
>      <value>iuser</value>
>     </parameter>
>
>     <!-- Class name for JDBC driver -->
>     <parameter>
>        <name>driverClassName</name>
>        <value>org.hsqldb.jdbcDriver</value>
>     </parameter>
>
>     <parameter>
>       <name>url</name>
>       <value>jdbc:hsqldb:hsql://asterix</value>
>     </parameter>
>   </ResourceParams>
></Context>
>
>
>WEB.XML
>--------
>
>   <resource-ref>
>     <description>DB Connection</description>
>     <res-ref-name>jdbc/TestDB</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
>   </resource-ref>
>
>Servlet code
>-------------
>
>       Context initCtx = new InitialContext();
>       Context envCtx = (Context) initCtx.lookup("java:comp/env");
>
>       DataSource ds = (DataSource)envCtx.lookup("jdbc/TestDB");
>
>
>       if (ds != null) {
>         Connection conn = ds.getConnection();
>
>//"value" of DS is "org.apache.commons.dbcp.BasicDataSource@b6548"
>//and here is exception  in "Connection conn = ds.getConnection();"
>
>java.sql.SQLException: Cannot load JDBC driver class 'null'
>         at
>org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
>rce.java:529)
>         at
>org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
>.java:312)
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

Sean Dockery
[EMAIL PROTECTED]
Certified Java Web Component Developer
Certified Delphi Programmer
SBD Consultants
http://www.sbdconsultants.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to