Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 48391 invoked from network); 2 Sep 2002 06:45:40 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 2 Sep 2002 06:45:40 -0000 Received: (qmail 29402 invoked by uid 97); 2 Sep 2002 06:45:25 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 29319 invoked by uid 97); 2 Sep 2002 06:45:23 -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 29306 invoked by uid 98); 2 Sep 2002 06:45:22 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) From: "Robert Dunn" To: "Tomcat Users List" Subject: RE: getConnection() returning a NULL JDBC driver Date: Mon, 2 Sep 2002 16:44:48 +1000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0004_01C252A0.0CD13F40" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <006d01c25226$5581ccc0$ed70a8c0@HMONTDOMAIN> X-OriginalArrivalTime: 02 Sep 2002 06:46:21.0890 (UTC) FILETIME=[72ECAA20:01C2524C] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0004_01C252A0.0CD13F40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Rosdi, I tried your suggestions without much luck. When I create a context reference to the Interbase DB the code fails on the following line: DataSource ds = (DataSource) envCtx.lookup("jdbcTranshub"); with the error: Name jdbcTranshub is not bound in this Context The entry I created in the Server.XML file is: Java code is: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbcTranshub"); Connection conn = ds.getConnection(); Any other ideas? Thanks in advance, Rob. PS: I did remove the "Resource-Ref" out of the web.xml file as well. -----Original Message----- From: Rosdi bin Kasim [mailto:rosdi@epantai.com.my] Sent: Monday, 2 September 2002 12:13 PM To: Tomcat Users List Subject: Re: getConnection() returning a NULL JDBC driver Robert, First of all.., I am using Oracle and Tomcat 4.1.9, so my answer might not apply to your problem.. I got the same error like yours.. but after I removed all reference to the datasource in web.xml and then I declared a ResourceLink like this in my server.xml my program is running perfectly. Here is my global datasource in server.xml username epuser url jdbc:oracle:thin:@localhost:1521:epantai password zaq12wsx maxActive 20 maxWait 5000 driverClassName oracle.jdbc.driver.OracleDriver maxIdle 10 And then here is the resource link for my application, also in server.xml. Then I create a singleton class to initialise the datasource, all my codes then get the connection from this singleton class. I attach the server.xml, web.xml, ConnCache.java, and DatabaseManager.java for your reference. Hope that helps.. Regards, Rosdi. ----- Original Message ----- From: "Robert Dunn" To: "Tomcat Users List" Sent: Monday, September 02, 2002 9:37 AM Subject: getConnection() returning a NULL JDBC driver > Hi all, > > I am attempting to get a connection to the JDBC entry from the server.xml > file and keep getting the error "Cannot load JDBC driver class 'null'". The > error occurs when I attempt to call "ds.getConnection();". I have placed all > of the Interbase JAR files in the Common\Lib directory; Do I need > to register these with Tomcat somehow? > > All of the files/system are detailed below. Any ideas would be helpful. > > Platform: > WinXP > Tomcat 4.1.9 Stand Alone > > Java code: > Context initCtx = new InitialContext(); > Context envCtx = (Context) initCtx.lookup("java:comp/env"); > DataSource ds = (DataSource) envCtx.lookup("jdbc/Transhub"); > Connection conn = ds.getConnection(); > > The entry in the web.xml file is as follows: > > Interbase JDBC > jdbc/Transhub > javax.sql.DataSource > Container > > > Entry from the server.xml file is: > > type="javax.sql.DataSource" > description="Resource name for the interbase client connection"/> > > > description > Resource Parameters for the Transhub Interbase DB > > > maxActive > 8 > > > maxIdle > 4 > > > user > sysdba > > > password > XXXX > > > driverClassName > interbase.interclient.Driver > > > url > jdbc:interbase://localhost/C:/Program Files/Common Files/Insfin > Shared/data/iitweb.gdb > > > > Thanks in advance, Rob :-> > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > ------=_NextPart_000_0004_01C252A0.0CD13F40 Content-Type: text/xml; name="server.tomcat-user.xml" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="server.tomcat-user.xml" username sysdba password XXXXXXXXX =20 description Resource Parameters for the Transhub Interbase DB maxActive 8 maxIdle 4 =20 driverClassName interbase.interclient.Driver =20 url jdbc:interbase://localhost/C:/temp/iitweb.gdb factory = org.apache.catalina.users.MemoryUserDatabaseFactory pathname conf/tomcat-users.xml usersa password driverClassName org.hsql.jdbcDriver driverName jdbc:HypersonicSQL:database mail.smtp.host localhost ------=_NextPart_000_0004_01C252A0.0CD13F40 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------=_NextPart_000_0004_01C252A0.0CD13F40--