SHARE
TWEET

Untitled

a guest Jun 8th, 2017 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package fanese.web.model;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. public class Database {
  8.  
  9.     private static final String DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
  10.     private static final String JDBC_URL = "jdbc:sqlserver://localhost;user=sa;password=123456;databaseName=UN3";
  11.  
  12.     public static Connection getConnection() throws SQLException {
  13.         try {
  14.             Class.forName(DRIVER);
  15.         } catch (ClassNotFoundException e) {
  16.             throw new IllegalStateException(e);
  17.         }
  18.  
  19.         return DriverManager.getConnection(JDBC_URL);
  20.     }
  21.  
  22. }
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