Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Polling in Oracle 10g Using NetBeans ID

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing the problem while connecting to oracle10g using DataSource approach.I am using classes12.jar in my classpath. I am able to connect to database if i harcode the values in JSP.

I am getting error as follows


Source code

Index.jsp

I am able to get connection and retrive the results properly if i hadcode the values.I have commented this code.




Web.xml





context.xml




Please help me
 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PLease let me know if a anybody knows the solution
 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

your code uses this driver:
// Class.forName("oracle.jdbc.driver.OracleDriver");// driver

But Tomcat tries to load this driver:
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

There is a subtle difference

Either install proper driver file somewhere in the classpath (the best place is $CATALINA/lib) , or change the driver name in context.xml.

As described here:
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
For Oracle 9i onwards you should use oracle.jdbc.OracleDriver rather than oracle.jdbc.driver.OracleDriver as Oracle have stated that oracle.jdbc.driver.OracleDriver is deprecated and support for this driver class will be discontinued in the next major release.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic