ice78991
Programmer
- Nov 20, 2006
- 216
I have just downloaded the JDBC Drivers for SQl Server 2005 from Microsoft. Can I use these drivers to connect to a sql server using a TCP connection. I am looking for something similar to the following c# code in java
string str = "Data Source=127.0.0.1,1909;" +
"Network Library=DBMSSOCN;" +
"Initial Catalog=master;" +
"User ID=sa;" +
"Password=pass;";
try
{
myConnection = new SqlConnection(str);
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
string str = "Data Source=127.0.0.1,1909;" +
"Network Library=DBMSSOCN;" +
"Initial Catalog=master;" +
"User ID=sa;" +
"Password=pass;";
try
{
myConnection = new SqlConnection(str);
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}