Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
- When the driver is loaded, you can establish a connection by using a connection URL and the getConnection method of the DriverManager class:
- Copy
- String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
- "databaseName=AdventureWorks;user=MyUserName;password=*****;";
- Connection con = DriverManager.getConnection(connectionUrl);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement