package com.msksbr.SQL;

import java.sql.*;

public class Connector {
    private Connection conn;
    private Statement stmt;
    private String url="sqlmsksbr.com";
    private Integer port=1433;
    private String username="sa";
    private String password="nothx";
    private String database="book";
    private Boolean encrypted=false;

    private String loginURL=new UserInfo(url,port,database,username,password,encrypted).GetUserInfo();

    public Connector() throws ClassNotFoundException, SQLException {
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        conn = DriverManager.getConnection(loginURL);
        stmt = conn.createStatement();
    }

    public ResultSet executeQuery(String query) throws SQLException {
        return stmt.executeQuery(query);
    }

    public int executeUpdate(String query) throws SQLException {
        return stmt.executeUpdate(query);
    }
}
