package com.msksbr.SQL;

import java.sql.*;

public class Connector {
    private Connection conn;
    private Statement stmt;
    private String url = "jdbc:mysql://localhost:3306/book";
    private String user = "root";

    public Connector() throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.cj.jdbc.Driver");
        conn = DriverManager.getConnection(url, user, new PassWord().passWord);
        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);
    }
}
