Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public Connection openConnection() throws SQLException, ClassNotFoundException {
- if (checkConnection()) {
- return connection;
- }
- String connectionURL = "jdbc:mysql://" + this.hostname + ":" + this.port;
- if (database != null) {
- connectionURL = connectionURL + "/" + this.database;
- }
- Class.forName("com.mysql.jdbc.Driver");
- connection = DriverManager.getConnection(connectionURL, this.user, this.password);
- return connection;
- }
Add Comment
Please, Sign In to add comment