• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem occurs when connecting to thin driver...

 
chaitanya gopal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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(FirstJdbc.java:23)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

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?

Thanks,
Chaitanya.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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


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.

Thanks,
Shailesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic