Hi all, I'm writing a small servlet which connects to a remote ORACLE 8i database. The class definition is: Class.forName("oracle.jdbc.driver.OracleDriver"); But, when i run the servlet using tomcat, The ClassNotFoundException is fired and i get the following message: "JDBC-ORACLE Class not found: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver" What is wrong here and which file do i need or which path do i have to set and where. The OS is Windows2000. Thanx
If you are depolying the zip under the WEB-INF/lib directory Tomcat will not find it. It needs to have a jar extention to be included. Unzip on your machine and jar it using the jar tool. Now when you put it back, things should work.
As Carl mentions, you can place the jar'd version of the Oracle driver in your WEB-INF/lib directory.
I have an app that uses the zip version, but it's on my system CLASSPATH, which Tomcat seems to be able to use for this purpose.
I was under the impression it needed to be in WEB-INF/lib, and I had it there. But when Carl posted, I removed it and restarted the server, and my app still works.. so it must be getting it from the System CLASSPATH.
Also an excellent read on the topic of class loading is the WROX book "Professional JSP 2nd Edition". For those of you that have access to this book, and are interested, page 736-738 are very enlightening.