Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 7846 invoked by uid 500); 3 Oct 2001 22:37:53 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 7830 invoked from network); 3 Oct 2001 22:37:52 -0000 Message-ID: <002501c14c5c$044111c0$6401a8c0@closeminded> From: "Brian Richards" To: Subject: 2 webapps 2 jars 1 driver? Date: Wed, 3 Oct 2001 18:37:42 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ok I am running two applications that use the IBM DB2 appdriver to connect to two different databases. The problem is this when i start up tomcat only one of the applications can access the database. The first one to have a request made wins and the other app gets a No Suitable Driver exception. They both work independtly as long as it's the first one requested. My theory is that the Class.forName(driver) being called twice is mucking things up the code at fault is: The obeject that owns this code is instatiated in in jspInit() and load is called only once. Any other theories? Thanks Brian ps I'm using Tomcat 3.3, jdk1.3.1 WIN2k. and Apace 1.3.6 and the two applications are in two different virtual hosts but i get teh same error when they are both in the same host. public Connection driverManager() throws SQLException { return DriverManager.getConnection(getURL(), getUserID(), getPassword()); } public boolean load(Properties prop) { if (prop!=null) { try { driver = (String)prop.get("driver"); password = (String)prop.get("password"); URL = (String)prop.get("url"); userID = (String)prop.get("user"); dataSourceName = (String)prop.get("datasource"); try { Class.forName(getDriver()); } catch (ClassNotFoundException cnfe) { System.err.println(getDriver()+" could not be found."); } } catch (NullPointerException npe) { return false; } } return true; }