Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class Connector {
- public static Connection startConnection(){
- Connection con = null;
- try {
- Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
- String connectionUrl = "jdbc:sqlserver://localhost:1433;database=uaa;" +
- "user=juan;" +
- "password=123";
- con = DriverManager.getConnection(connectionUrl);
- System.out.println("Connected Successfully");
- }catch (Exception e) {
- System.out.println("Could not connect because: " + e);;
- }return con;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement