Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 43298 invoked from network); 12 Feb 2002 13:27:46 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Feb 2002 13:27:46 -0000 Received: (qmail 25485 invoked by uid 97); 12 Feb 2002 13:27:25 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 25431 invoked by uid 97); 12 Feb 2002 13:27:24 -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 25420 invoked from network); 12 Feb 2002 13:27:24 -0000 Message-ID: <3A9D17BF9810D41196A300D0B7445779288847@THOR> From: Brian Adams To: 'Tomcat Users List' Subject: RE: database connect to db overr mod_webapp - possible bug Date: Tue, 12 Feb 2002 07:24:42 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N can we see the errors? -----Original Message----- From: Chris Faulkner [mailto:christopher.faulkner@ntlworld.com] Sent: Tuesday, February 12, 2002 7:26 AM To: Tomcat Users List Subject: database connect to db overr mod_webapp - possible bug Hi I have a JSP which,when called direct into Tomcat (4.0.1) on Linux works fine. It connects to a database, retrieves results, fine. http://host_a:8080/ism/JSP/file.jsp?param1=value¶m2=value "host_a" is a vrtual host defined in my apache config and in the DNS servers on our LAN. In the virtual host setting of Apache, I have WebAppConnection coni warp localhost:8008 WebAppDeploy ism coni /ism/ Static pages,servlets and JSP are fine across mod_webapp. However, when I try my database JSP, I get errors. This code is in the JSP when I go through 8080 and it WORKS, it connects to the DB and all goes OK. So my configuration of the jdbc/IsmDB must be OK. I created the JDBC datasources as outlined at the Tomcat website. Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); javax.sql.DataSource ds = (javax.sql.DataSource)envCtx.lookup("jdbc/IsmDB"); Connection conn = ds.getConnection(); However, when I connect to the page via Apache, the third line fails the connection to the database fails. I replace those 4 lines with the following and it works. String sConn = "jdbc:oracle:thin:@ip:port:sid"; // connnection string DriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver() ); Connection conn=DriverManager.getConnection( sConn, "user", "password" ); Statement stmt = conn.createStatement(); So have I missed some configuration to make the database connection work over mod_webapp or is this a bug ? Thanks Chris -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: For additional commands: Troubles with the list: