tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twcTC <>
Subject Re: configure data source
Date Sat, 17 Apr 2004 05:37:21 GMT
I have the same problem

-----Original Message-----
From: Niraj Alok <>
Sent: Apr 16, 2004 8:04 PM
To: Tomcat Users List <>
Subject: configure data source

 Hi All,

 I am trying to obtain a connection using DataSource
 in Tomcat5 .

 I get the following error :

 org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
 class '' for connect URL 'null', cause:

 java.sql.SQLException: No suitable driver

 My source code is :

     Context ctx = new InitialContext();

     if (ctx == null)

         throw new Exception("No context got! Exception");

     System.out.println("got ctx");

     DataSource ds =

         (DataSource) ctx.lookup("java:comp/env/jdbc/hypersonic");

     if(ds == null)

         throw new Exception("No ds got! Exception");



     System.out.println("got ds");

     Connection con = ds.getConnection();

     if(con != null)


 My server.xml looks like :


<Environment name="simpleValue" type="java.lang.Integer" value="30"/>

<Resource auth="Container" description="User database that can be updated
and saved" name="UserDatabase" type="org.apache.catalina.UserDatabase"/>

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

<ResourceParams name="UserDatabase">










<ResourceParams name="hypersonic">































   My web.xml contains:


   <description>DB Connection</description>





   Even if i comment this entry in web.xml the error is still the same.

   Can any one please tell me what am I doing wrong??


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message