|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem with Tomcat and Oracle 9i
Hello,
I am running Tomcat and Oracle 9i. I am trying to get my connection pooling working so I can use a JNDI. But I am having a problem. When I include everything in a jsp file it connects to the database and produces a result. Connection conn = null; try { Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection( "jdbc racle:thin:@xxx.xxx.xx.xx:1521:dev","happy", "xxxx"); When I have it in the Context I just get: A Java.nullpointerexception My server.xml is: <parameter> <name>url</name> <value>jdbc racle:thin:@xxx.xxx.xxx.xxx:1521:dev</value></parameter> With the same parameters for username and password as above. My servlet is: Context ctx = new InitialContext(); if(ctx == null ) throw new Exception("Oops - No Context"); DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/database"); if (ds != null) conn = ds.getConnection(); All your help is appreciated: CC |
|
#2
|
|||
|
|||
|
I do not use Tomcat connection pooling as we use Websphere, but here is the how-to for JNDI connection pooling in Tomcat. Hope it helps
http://jakarta.apache.org/tomcat/to...ples-howto.html |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Problem with Tomcat and Oracle 9i |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|