A very simple question but i’m newbie in Java. How can I do the connection with my SQL Server DataBase that are in my network ?
I made the download of the JDBC 4.0, associate the file in my project and I’m trying the follow code, but I don’t know how can I do a reference to my database
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl = "what i put here ?";
Connection con = DriverManager.getConnection(connectionUrl, "sa", "testtest");
} catch (SQLException e) {
e.printStackTrace();
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
replace the url/username/password. This is the connectionstring for sql server