I wrote a Java Servlet program but when I run it, it was showing the Exception

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

When I give the

 java oracle.jdbc.driver.OracleDriver 

command in command prompt, it was showing following lines


Error: Main method not found in class oracle.jdbc.driver.OracleDriver, please define the main method as:
       public static void main(String[] args)

Solution :

ave you copied classes12.jar in lib folder of your web application and set the classpath in eclipse.

Right-click project in Package explorer Build path -> Add external archives…

Select your ojdbc6.jar archive

Press OK

Or

Go through this link and read and do carefully.

The library should be now referenced in the “Referenced Librairies” under the Package explorer. Now try to run your program again.

Laisser un commentaire