Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>Connection String for SQL Server 2000 JDBC Driver</b>

Status
Not open for further replies.

markbanker

Programmer
Mar 6, 2001
37
US
I am trying to make a connection to SQL Server 2000 from an application and I receive an error message telling me that no suitable driver can be found.

Here is my code:

try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
catch (ClassNotFoundException e)
{
System.err.println("I could not find the driver.");
e.printStackTrace();
}

String url = "jdbc:microsoft:sqlserver://ServerName:1433;DatabaseName=Flintstones";

try
{
Connection con = DriverManager.getConnection(url, "swim", "swim");
}

I am using SQL Server 2000 on Windows 2000. I have the SQL Server 2000 Driver for JDBC, Version 2.2


Does anyone see where my problem is? Your help is greatly appreciated.

Thanks,

Mark
 
Is this Java code? If so you may have better luck if you post in one of the Java forums. --James
 
Using jTDS (opensource driver for SQLServer/Sybase available from Sourceforge) it's:
Driver: net.sourceforge.jtds.jdbc.Driver
Url: jdbc:jtds:sqlserver://host:port/database
Stick to your guns
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top