Hi!
I have to do a program to connect to a SQL Server with JDBC, and I have two question
1-
Can I connect to SQL Server with JDBC o with this code??
SqlConnection con = new SqlConnection();
con.ConnectionString = ("Data source=...; Initial Catalog=...; User Id=...; Password=..");
con.Open();
Can I only connect one way to the SQL server or can I choose how to connect?
2-
I have this program
String userName =
"username";
String password =
"password";
String url =
"jdbc:sqlserver://MYPC\\SQLEXPRESS;databaseName=MYDB";
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection
conn = DriverManager.getConnection(url,
userName, password);
And I have an Error with Class.forName, because my Visual c# doesn´t recognize, What library have to add it to work?
And another question, I am using Windows XP and Microsoft Visual C # 2010, need some special Instruction or library to connect to SQL Server?
Thanks for all!