tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakarta Tomcat Newsgroup ( <>
Subject databases and JNDI resource problem
Date Wed, 01 May 2002 14:40:02 GMT
Subject: databases and JNDI resource problem
From: guido schnider <>
While trying to connect a mysql DB with Tomcat 4.0.4-b1 ant struts 1.x 
as described in the Tomcat manual under JNDI Resources HOW-TO
I get the following error. It looks like that he is still looking for 
the HypersonicDriver as in the example, but i changed it.
Any ideas or working examples?

TyrexDataSourceFactory:  Cannot create DataSource, Exception
java.lang.ClassNotFoundException: org.hsql.jdbcDriver

PS: What is the smartest way working with Db's and tomcat/struts?

My configuration
<!-- server.xml  -->
<Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/test">
<!-- Web.xml  -->
     Resource reference to a factory for java.sql.Connection
     instances that may be used for talking to a particular
     database that is configured in the server.xml file.
//java file
public static final Connection getConnection() throws SQLException {
     try {
         Context env = (Context) new 
         DataSource ds = (DataSource) env.lookup("jdbc/test");
         if (ds==null)
             throw new SQLException("Cannot connect to mysql db test");
     catch (NamingException ne) {
         throw new SQLException(ne.getMessage());

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message