Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ClassNotFoundException: oracle.jdbc.driver.OracleDriver

843859Jun 4 2008 — edited Nov 20 2014
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 3 2008
Added on Jun 4 2008
9 comments
317 views