Hello,
I've got a serious problem that I can't figure out. My problem is the first exeption is always catched : "java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver"
My code is:
Connection connection = null;
try
{
Driver driver = (Driver) Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
DriverManager.registerDriver(driver);
connection = DriverManager.getConnection("jdbc:oracle:thin:@myDataBase:port:1521");
out.println("connection ok");
}
catch(ClassNotFoundException e)
{
out.println("Driver class not found" + e);
}
catch(SQLException e)
{
out.println("DB connection impossible" + e);
}
catch (InstantiationException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IllegalAccessException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
I use Eclipse Version: 3.1.1 and JDK 1.4
My DataBase is Oracle 10g Release 1 (10.1)
I downloaded ojdbc14.jar (for Oracle 10.1.0.2)
Of course I added this jar to WEB-INF/lib and right click -> Build Path -> Add to Build Path
I don't understand why I completely desperate. Please help me.