File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes java.sql.SQLException: No suitable driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: No suitable driver" Watch "java.sql.SQLException: No suitable driver" New topic
Author

java.sql.SQLException: No suitable driver

Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
Hi
I am trying to do simple jdbc program


can anybody help me to come out?

Thanks

Vaishali


SCJP, SCJD
Preparing for SCWCD
Jared White
Greenhorn

Joined: Aug 11, 2004
Posts: 7
Is the jar containing your JDBC driver in your classpath?
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
please can you tell me which jar file is needed in classpath.

I am using oracle 10g.

Thanks

Vaishali
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29261
    
140

It's called classes12.jar or ojdbc-14.jar for Oracle.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
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
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13881
    
  10

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 "jdbcdbcracle". 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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 106
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: No suitable driver
 
Similar Threads
How do I use Oracle's thin Driver ?
Finding out the correct URL
Establishing Connection to MS Access Databases
java.sql.SQLException: No suitable driver
no suitable driver found..