• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JDBC Error

 
Ranch Hand
Posts: 99
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 jdbc:oracle:thin:@localhost:1521:orcl
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



 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 74699
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We usually discuss databases on a different forum. Moving.
reply
    Bookmark Topic Watch Topic
  • New Topic