I have Java -version:
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
And Oracle 11.2 with Windows 8
I am trying to run a Dynamic Web Project from Eclipse. All works fine until I try to:
DriverManager.registerDriver(
new oracle.jdbc.OracleDriver()
);
Then it says:
PWC6197: An error occurred at line: 8 in the jsp file: /showUser.jsp
PWC6199: Generated servlet error:
package oracle.jdbc does not exist
I have added (As an external JAR) the ojdbc file (ojdbc7.jar):
But still java isn't able to find the package oracle.jdbc.
My .jsp is:
Title
try {
// Load Oracle Driver class file
DriverManager.registerDriver(
new oracle.jdbc.OracleDriver() //
);
...
%>
I have googled many other questions but the solution is far from clear! What exactly should I do to correctly include oracle.jdbc.OracleDriver ?
Spec
java version "1.7.0_25"
Oracle 11.2
Windows 8 (64bit)
Eclipse Kepler
解决方案
I think I have solved it: I had to put ojdbc7.jar in the Tomcathome/lib directory
And I had to manually run the server with TomCat: