• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

No suitable driver using msql

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI all

i am trying to fetch values from SQL database which is present in remote server.The url string of my code is

String url = "jdbc:msql://10.87.125.74:8080/DatabaseName";
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection(url,"Ajay","Singh");
Statement stmt = conn.createStatement();
ResultSet rs;

rs = stmt.executeQuery("SELECT * from Employee");
while ( rs.next() )
{
String name = rs.getString("Name");
System.out.println(name);
}
conn.close();


Now when i run my code the following error comes

"No suitable Driver".i have downloaded oracle drivers(or which driver should i download?) and set them in the class path but still the same problem.Kindly help
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"oracle.jdbc.driver.OracleDriver"

I would expect to see the MySql Driver here...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am quite sure that JDBC URL you're using is not correct for an Oracle database. Consult the Oracle driver documentation for what to use instead.
 
Ajay Singh
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have googled through and found this driver to be used for msql database


Class.forName("com.imaginary.sql.msql.MsqlDriver");

but i am not getting from where to download the above mentioned driver.

Also can we use MySql driver ?

As far as i know MS Sql ,MySql ,and mSQL are three different things
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep, I misread. You still need to get the jdbc url and driver correct though.
 
Ajay Singh
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried to download the mSQL driver from

http://www.imaginary.com/Java/

but it says page cannot be found:-(
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So why did you choose that particular page? When I google for "msql" I find several pages for a company that claims to have distributed MSql since 1994, but not that one.

None of those pages mentions JDBC, either, but I only spent 30 seconds researching. I would say don't start writing your program to use MSql until you see what it can do.

Edit: But apparently you already have MSql running on a server somewhere. In that case I would go and talk to the administrator of that server. They should have contacts for MSql. They might already have a JDBC driver as part of their installation.
[ July 24, 2008: Message edited by: Paul Clapham ]
 
Ajay Singh
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks everybody for the replies.The database is changed to Ms Sql and now its working fine now:-)
reply
    Bookmark Topic Watch Topic
  • New Topic