Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- public class DBConnector {
- private static final String HOST = "jdbc:mysql://localhost:3306/keypass?useUnicode=true&useSSL=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
- private static final String USERNAME = "root";
- private static final String PASSWORD = "13qe2w13";
- private Connection connection;
- public Connection getConnection() {
- return connection;
- }
- public DBConnector() {
- try {
- connection = DriverManager.getConnection(HOST, USERNAME, PASSWORD);
- }catch (SQLException e){
- e.getMessage();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement