daily pastebin goal
25%
SHARE
TWEET

b

a guest Apr 27th, 2018 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top