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

No suitable driver using msql

Ajay Singh
Ranch Hand

Joined: Jan 04, 2008
Posts: 105
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
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"oracle.jdbc.driver.OracleDriver"

I would expect to see the MySql Driver here...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
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.


Ping & DNS - my free Android networking tools app
Ajay Singh
Ranch Hand

Joined: Jan 04, 2008
Posts: 105
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

Joined: Mar 06, 2001
Posts: 13459

Yep, I misread. You still need to get the jdbc url and driver correct though.
Ajay Singh
Ranch Hand

Joined: Jan 04, 2008
Posts: 105
i tried to download the mSQL driver from

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

but it says page cannot be found:-(
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: Jan 04, 2008
Posts: 105
thanks everybody for the replies.The database is changed to Ms Sql and now its working fine now:-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No suitable driver using msql