• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Error

 
Varshini Priya
Ranch Hand
Posts: 95
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Im trying to execute the below simple JDBC program, but Im getting the below exeception while executing it. Please Assist





The error that I received is



Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbcracle:thin:@localhost:1521rcl
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at MyFirstDBConnection.main(MyFirstDBConnection.java:21)


How do I resolve this. Please Advise, Many Thanks

Regards,
Varshini



 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you put the Oracle JDBC driver in the classpath?

This usually comes in a jar named classes12.jar. You should be able to find it in your oracle software distribution media. You could check with your db admin.
 
Swastik Dey
Rancher
Posts: 1602
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This usually comes in a jar named classes12.jar. You should be able to find it in your oracle software distribution media. You could check with your db admin.


That is very old jar which does not even support JDBC 3 features . you must be at least using ojdbc14.jar. Check the version of oracle and choose your driver jar.




It may be the issue if you are using driver which is not JDBC 4.0 complaint. From JDBC 4.0 ,its not required to the load the driver programatically.
 
Campbell Ritchie
Sheriff
Posts: 48386
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We usually discuss databases on a different forum. Moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic