Advertisement
Guest User

b

a guest
Apr 27th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
  2.  
  3. When the driver is loaded, you can establish a connection by using a connection URL and the getConnection method of the DriverManager class:
  4.  
  5.  
  6. Copy
  7. String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
  8. "databaseName=AdventureWorks;user=MyUserName;password=*****;";
  9. Connection con = DriverManager.getConnection(connectionUrl);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement