Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jdbc driver does not become available to my java program 1

Status
Not open for further replies.

roopan27

Programmer
Feb 17, 2004
8
US
Hey,
I have placed the jdbc driver OracleDriver.class that I need in the common/lib directory of tomcat.But when I compile my java program it gives me the following error:
.\pgms\DbOperations.java:11: package oracle.jdbc.driver does not exist
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

It was not giving me this error a few days back. now the program compiles only if I put the oracle driver class in the web-inf/classes directory of my application.
can somebody help?
 
You have to make sure that the directory that contains your driver package (ie. the directory that contains the package "oracle.jdbc.driver.*") is in your compiler classpath.

It works when it is in your classes directory because that is where your classes are being compiled to.

If the driver is in a jar file, then make sure the jar file name (along with its absolute path) is specified in the classpath.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top