Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Connection getSQLConnection() {
- try {
- if (sql_connection == null || sql_connection.isClosed()) {
- Class.forName("com.mysql.jdbc.Driver");
- String url = "jdbc:mysql://" + sql.get(0) + ":" + sql.get(1) + "/" + sql.get(2);
- sql_connection = DriverManager.getConnection(url, sql.get(3), sql.get(4));
- }
- } catch (ClassNotFoundException | SQLException e) {
- this.getLogger().log(Level.SEVERE, null, e);
- }
- return sql_connection;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement