Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fanese.web.model;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- public class Database {
- private static final String DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
- private static final String JDBC_URL = "jdbc:sqlserver://localhost;user=sa;password=123456;databaseName=UN3";
- public static Connection getConnection() throws SQLException {
- try {
- Class.forName(DRIVER);
- } catch (ClassNotFoundException e) {
- throw new IllegalStateException(e);
- }
- return DriverManager.getConnection(JDBC_URL);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement