Skip to Content
0
Former Member
Dec 19, 2007 at 03:48 PM

JDBC connection to MS SQL Database

35 Views

Hi all,

I am trying to connect to a MS SQL database. I am using following code:

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

String url = "jdbc:microsoft:sqlserver://server:1433/pubs";

Connection conn = DriverManager.getConnection(url,"user","password");

I am getting following error:

ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

I have already downloaded the jar files from the microsoft page and imported them into the project.

Can anybody help?

Thanks

Ismail