tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bussie, Andre D" <andre.d.bus...@lmco.com>
Subject Cannot create JDBC driver of class
Date Thu, 29 Jul 2004 17:13:11 GMT
At a standstill with accessing a datasource through JNDI in Tomcat
5.0.19.

 

Snippet of server.xml

...

<Context displayName="Jakarta Struts Testing Web Application"
docBase="phone" path="/phone">

  <Resource auth="Container" description="Database Connection for the
phone web application" name="jdbc/phone" type="javax.sql.DataSource"/>

  <ResourceParams name="jdbc/phone">

    <parameter>

                        <name>url</name>

                        <value>jdbc:hsqldb.hsql://localhost</value>

            </parameter>

            <parameter>

               <name>driverClassName</name>

               <value>org.hsqldb.jdbcDriver</value>

            </parameter>

  </ResourceParams>    

  </Context>

....

<GlobalNamingResources>

...

<Resource name="jdbc/phone" type="javax.sql.DataSource"/>

.......<ResourceParams name="jdbc/phone">

      <parameter>

        <name>maxWait</name>

        <value>5000</value>

      </parameter>

      <parameter>

        <name>maxActive</name>

        <value>4</value>

      </parameter>

      <parameter>

        <name>password</name>

        <value></value>

      </parameter>

      <parameter>

        <name>url</name>

        <value>jdbc:hsqldb.hsql://localhost</value>

      </parameter>

      <parameter>

        <name>driverClassName</name>

        <value>org.hsqldb.jdbcDriver</value>

      </parameter>

      <parameter>

        <name>maxIdle</name>

        <value>2</value>

      </parameter>

      <parameter>

        <name>username</name>

        <value>sa</value>

      </parameter>

    </ResourceParams>

 

....

Here is a snippet of web.xml

<resource-ref>

    <description>Database Connection for the phone web
application</description>

      <res-ref-name>jdbc/phone</res-ref-name>

      <res-type>javax.sql.DataSource</res-type>

      <res-auth>Container</res-auth>

  </resource-ref>

 

Snippet of context.xml

<?xml version='1.0' encoding='utf-8'?>

<Context displayName="Jakarta Struts Testing Web Application"
docBase="phone" path="/phone">

 <ResourceLink name="jdbc/phone" global="jdbc/phone"
type="javax.sql.DataSource"/>

</Context>

 

 

Code Snippet

Context ctx = new InitialContext();

   Context env = (Context)ctx.lookup("java:comp/env");

   DataSource ds = (DataSource) env.lookup("jdbc/phone");

   Connection conn = ds.getConnection();

   try{

 

Error message received

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class 'org.hsqldb.jdbcDriver' for connect URL
'jdbc:hsqldb.hsql://localhost', cause: 

java.sql.SQLException: No suitable driver

 

 What more can I do to get this working?

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message