aspose file tools*
The moose likes JDBC and the fly likes Not Suitable Driver Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Not Suitable Driver Error" Watch "Not Suitable Driver Error" New topic
Author

Not Suitable Driver Error

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Hi ,

I am using Oracle in my project .

try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch(ClassNotFoundException e){e.printStackTrace();}

try {
Connection con = DriverManager.getConnection("jdbc racle:thin@localhost:1521:STUDENT","scott","tiger");
//STUDENT is database name , scott is username , tiger is password

// Some Java Code

} catch(SQLException e){e.printStackTrace();}


The error I am getting is " Not Suitable Driver " .
What may be the reason ...

Thanks .
Akshay Sharma
Ranch Hand

Joined: Mar 27, 2003
Posts: 42
classes111.zip or classesXXX.zip

whoch contains the class for the thion driver is not in your classpath


Akshay Kumar Sharma<br />**********************<br />Good Better Best <br />Never Let it rest<br />For your good is better<br />and the better is the best
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
How can I set class111.zip file in my class path .
Please provide commands .
thanks .
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30294
    
150

Rathi,
On a Windows machine:

On UNIX/Linux, substitute a colon for the semicolon. Also, if this is something you do often, you can set the classpath as an environment variable in the control panel.


[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
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
After setting this classes.zip into classpath . I am getting this error :
" Invalid Oracle URL Specified "

Now please tell me that what is problem & what should I do now ?

thanks .
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30294
    
150

Rathi,
Try adding a colon after the thin. For example,
Sudipto Ghosh
Greenhorn

Joined: Jan 07, 2005
Posts: 11
OracleDriver doesn't register the driver with DriverManager unlike JdbcOdbcDriver. So you need to register the Driver manually.

DriverManager.registerDriver( new OracleDriver() );

Then you can call the getConnection menthod on DriverManager.
 
Consider Paul's rocket mass heater.
 
subject: Not Suitable Driver Error