Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 8934 invoked from network); 2 Apr 2002 18:58:32 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 2 Apr 2002 18:58:32 -0000 Received: (qmail 16591 invoked by uid 97); 2 Apr 2002 18:57:37 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 16510 invoked by uid 97); 2 Apr 2002 18:57:36 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 13542 invoked from network); 2 Apr 2002 09:37:30 -0000 content-class: urn:content-classes:message Subject: Problems with JDBC-Datasource as Resource in JNDI MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Tue, 2 Apr 2002 11:37:28 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.0.4712.0 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problems with JDBC-Datasource as Resource in JNDI Thread-Index: AcHaKgDgk81YKtr2RoSJtJ10qPP8Fg== From: "Frank Marx" To: "Tomcat Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, I defined a mysql-Datasource as a resource in JNDI. I can lookup the datasource but everytime when I call the Datasour - getConnection Method=20 the error message "no suitable driver" shows up. Here are my configuration files: WEB.XML: (only resource part) test jdbc/MySQLDB javax.sql.DataSource SERVER.XML: user quipi password devel driverClassName org.gjt.mm.mysql.Driver driverName jdbc:mysql:@qhds0004:3306:qRoom The JAVA - Code which tries to create the connection from the datasource: InitialContext ic =3D new InitialContext(); =20 DataSource ds =3D (DataSource)ic.lookup("java:comp/env/jdbc/MySQLDB"); =20 System.out.println("TEST:" + ic.INITIAL_CONTEXT_FACTORY); =20 // When I comment the following line of code out I don't get the exception but also // no connection :-(=09 Connection con =3D ds.getConnection(); =20 } catch(javax.naming.NamingException ex) { ex.printStackTrace(); } catch(java.sql.SQLException ex) { System.out.println(ex.getSQLState()); ex.printStackTrace(); } The mysql-jar is in the lib directory of the web - application and also lib - directory of my TOMCAT installation which is version 4.01. Any suggestions how to solve the problem ? Is the URL to the my-sql database ok or do I need to copy the mysql-drivers somewhere ? Thanks in advance, Frank Marx -- To unsubscribe: For additional commands: Troubles with the list: