Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not Suitable Driver Error

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
classes111.zip or classesXXX.zip

whoch contains the class for the thion driver is not in your classpath
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I set class111.zip file in my class path .
Please provide commands .
thanks .
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rathi,
Try adding a colon after the thin. For example,
 
Sudipto Ghosh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic