File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes problem occurs when connecting  to thin driver... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "problem occurs when connecting  to thin driver..." Watch "problem occurs when connecting  to thin driver..." New topic

problem occurs when connecting to thin driver...

chaitanya gopal

Joined: May 22, 2007
Posts: 13
Hi friends,
I am trying to load and connect to oracle driver like below... DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection con=DriverManager.getConnection("jdbcracle:thin:@localhost:1521rcl","scott","tiger");

It works fine in Netbeans IDE but Its not working in Eclipse, the same code.
In Eclipse it throws Exception like this:
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver FirstJdbc.doGet(
javax.servlet.http.HttpServlet.service( javax.servlet.http.HttpServlet.service(

I added ojdbc jar file for the library. and it has that OracleDriver class.
I must need to work on Eclipse IDE..Please let me know why?

Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082

java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver FirstJdbc.doGet(

where did you put ojdbc14.jar, you are getting a ServletException so I am assuming that you are loading driver from servlet. place the ojdbc14.jar in web-inf/lib folder.


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
I agree. Here's the link:
subject: problem occurs when connecting to thin driver...
It's not a secret anymore!