Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

java.sql.SQLException: No suitable driver

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am trying to do simple jdbc program


can anybody help me to come out?

Thanks

Vaishali
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the jar containing your JDBC driver in your classpath?
 
Vaishali Paramane
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please can you tell me which jar file is needed in classpath.

I am using oracle 10g.

Thanks

Vaishali
 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's called classes12.jar or ojdbc-14.jar for Oracle.
 
Vaishali Paramane
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it has in classpath

"c:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar";
"c:\oracle\product\10.2.0\db_1\jdbc\lib\nls_charset12.jar";
"c:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar"

Then also its giving error.


Thanks

Vaishali
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message means that either the JDBC driver is not in your classpath, or that the database URL you are using is wrong. Looking at your code, I see that the database URL you are using is "jdbc:odbc:oracle". Are you trying to use the JDBC-ODBC bridge driver to access Oracle?

See this question in the Oracle JDBC FAQ about what the database URL should look like.
 
Vaishali Paramane
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

"c:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar";
"c:\oracle\product\10.2.0\db_1\jdbc\lib\nls_charset12.jar";
"c:\oracle\product\10.2.0\db_1\jdbc\lib\classes12.jar"

This is in my class path and

I created 'oracle' as odbc in administrative tools.

I can't understand how to figerout problem.


Thanks

Vaishali
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic