Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 66424 invoked from network); 19 Jun 2002 15:11:23 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 19 Jun 2002 15:11:23 -0000 Received: (qmail 5484 invoked by uid 97); 19 Jun 2002 15:10:34 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 5313 invoked by uid 97); 19 Jun 2002 15:10:32 -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 5154 invoked by uid 98); 19 Jun 2002 15:10:30 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 content-class: urn:content-classes:message Subject: tomcat JNDI DB connection pool to Oracle MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Wed, 19 Jun 2002 11:10:28 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: tomcat JNDI DB connection pool to Oracle Thread-Index: AcIXo1COQguxUxTlQUGV0eSJv6TL7w== From: "Carlton Lo" To: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I've been successfully making JDBC connections directly in my JSP=20 Class.forName("oracle.jdbc.driver.OracleDriver"); ora_conn =3D DriverManager.getConnection("jdbc:oracle:oci8:@oracle8", = "user", "password"); Not I try to setup my Tomcat 4.0.2's JNDI DB connection pool, but I = can't get it to work Here is what I've done so far 1. Move the Oracle Drivers (classes12.zip) into \lib and=20 \common\lib directories and rename them to classes12.jar 2. Added the following codes to my webapp's web.xml jdbc/ora javax.sql.DataSource Container 3. Added the following codes within the tag of = \conf\server.xml user system password manager driverClassName oracle.jdbc.driver.OracleDriver driverName jdbc:oracle:oci8:@oracle8 =20 4. try to make connection within my JSP <%@ page import=3D"java.net.*" %> <%@ page import=3D"java.io.*" %> <%@ page import=3D"java.sql.*" %> <%@ page import=3D"javax.sql.*" %> <%@ page import=3D"java.util.*" %> <%@ page import=3D"javax.naming.*" %> <% try { Context initCtx =3D new InitialContext(); Context envCtx =3D (Context) initCtx.lookup("java:comp/env"); DataSource ds =3D (DataSource) envCtx.lookup("jdbc/ora"); Connection conn1 =3D ds.getConnection(); out.println("Win2000 Oracle Connected!
"); }=20 catch (SQLException E) { out.println("
unable to get connection on ora !");=20 out.println("
SQLException: " + E.getMessage()); out.println("
SQLState: " + E.getSQLState()); out.println("
VendorError: " + E.getErrorCode()); } %> Results : unable to get connection on ora !=20 SQLException: Cannot load JDBC driver class 'null'=20 SQLState: null=20 VendorError: 0=20 Why? I'm able to make connection call JDBC directly in my other JSP, but = not when I try to get the connection via JNDI Context ...?? Thank you in advnace ku=20 Carlton Lo Pluris 150 Speen Street Framingham, MA 01701 Tel: 508-663-1089 mailto:clo@plurisinc.com -- To unsubscribe, e-mail: For additional commands, e-mail: