I am using oracle 8.1.7 and using tomcat as web server.I downloaded classes12.zip from oracle website.I converted the zip file to jar file and placed the jar file in tomcat root directory\shared\lib folder.I also set the classpath for the jar file(to above path).I am getting Invalid path error when i compile a java file.The Code is given below.
The error i got is
package oracle.jdbc.driver does not exist
Help me please..Urgent
If everything in the JAR file seems to be OK, then it means your classpath is set wrong. That what the error means.
As a secondary point, you should NOT include the "DriverManger.registerDriver(...)" call in your code; it will be done for you as part of the "Class.forName(...)".
I would have said 'Firstly, ...' Please don't do this! Class.forName() will do this for you - a Driver is required to register itself when the class is loaded.
I'm confused why the Class.forName() appears to work, but the DriverManager call does not. Anyway, I usually recommend dropping the jar in the webapp/WEB-INF/lib directory rather than a common global directory.
Originally posted by Wayne L Johnson:
It is definitely a classpath issue. You say you "converted" the ZIP to a JAR file. Did you simply rename it (which is the correct thing to do), or did you do something else? If you did something else, you might want to open the JAR file and make sure the classes and paths (packages) are OK.
vasu, obviously you shouldn't zip the files like Wayne pointed out...though winzip can read jar files, it doesn't mean jar files & zip files are the same....you can always use the jar creator that comes along with java for creating jar files