aspose file tools*
The moose likes JSP 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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "java.sql.SQLException: No suitable driver " Watch "java.sql.SQLException: No suitable driver " New topic
Author

java.sql.SQLException: No suitable driver

Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
By using windows 2000 server, jsp 1.2 , ms access 2000

I want to connect to the ms access but its giving me

java.sql.SQLException: No suitable driver

MY code is below...
**********************************************
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

// Make a connection to the ODBC datasource iCare

Connection con = DriverManager.getConnection("jdbc dbc:iCare", "","");

*************************************************
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Hey Piyali

You need to configure required jar file in classpath.

Download it from here.
[ January 30, 2006: Message edited by: Chetan Parekh ]

My blood is tested +ve for Java.
Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
Hi Chetan !!!


Thx for the quick response... but i am not sure which jar file should i use and where to keep it

Plz provide me the steps ...
[ January 30, 2006: Message edited by: Piyali Mallick ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Piyali,
Typing with the caplock key down is the equivalent to yelling in a web forum and is considered rude.
Please go back and edit your previous post.

Thank you.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
I am really sorry 4 that . I have edited it
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Thank you.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The JDBC-ODBC Bridge libraries are in rt.jar which ships with your JRE.
You shouln't need to move anything to use it.
[ January 30, 2006: Message edited by: Ben Souther ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
I think this thread would be more suitable in JDBC forum. What you people think?
Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
set my clsspath like this ...
C:\j2sdk1.4.2_03\bin;C:\j2sdk1.4.2_03\jre\lib\rt.jar

still not able to connect...
what do i do...
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Which driver are you using ?
Add the driver's jar file to the classpath.


[My Blog]
All roads lead to JavaRanch
Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
still not getting which driver's jar r u talking about?
can u plz tell me in details .. i really need it..
plz help
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Sorry, I didn't realize you were using "sun.jdbc.odbc.JdbcOdbcDriver"
It's part of your SDK, so you shouldn't have anything to do.

Do you still have the same error ?
java.sql.SQLException: No suitable driver ?
Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
Yes Im still getting the error.
Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
creating my DSN - iCare

ODBC data source Administrator
System DSN
Microsoft Access Driver(*.mdb)

DSN name is iCare
Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
plz help me ... i have not got my answer.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Try "java -version" and post the version information here.
Confused
Ranch Hand

Joined: Jan 24, 2006
Posts: 54
Error java.sql.SQLException: No suitable driver .. solved

U know what I was doing ... i was calling the page from my server... although I have made the DNS in my local server.. when I called the page from my local web server.. it works fine.....

Thank u all for your help and time !!! :-)
[ February 23, 2006: Message edited by: Piyali Mallick ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.sql.SQLException: No suitable driver