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&param2=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:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to