|
|
@@ -2,19 +2,8 @@ package database;
|
|
|
|
|
|
import data.GuiMysql;
|
|
|
|
|
|
-import java.sql.Connection;
|
|
|
-import java.sql.DriverManager;
|
|
|
-import java.sql.SQLException;
|
|
|
-
|
|
|
public class Database extends GuiMysql {
|
|
|
|
|
|
- private static final String USERNAME = "OddsNy";
|
|
|
- private static final String PASSWORD = "Odds1_Ny_Password";
|
|
|
- private static final String DATABASE = "new_odds";
|
|
|
- private static final String URL = "jdbc:mysql://nordh.xyz:3306/";
|
|
|
- private static final String TIMEZONE_FIX = "?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
|
|
|
- private Connection conn;
|
|
|
-
|
|
|
public static final Database instance = new Database();
|
|
|
|
|
|
private Database() {
|
|
|
@@ -25,15 +14,4 @@ public class Database extends GuiMysql {
|
|
|
return instance;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- protected Connection getConnection() {
|
|
|
- if (conn == null) {
|
|
|
- try {
|
|
|
- conn = DriverManager.getConnection(URL + DATABASE + TIMEZONE_FIX, USERNAME, PASSWORD);
|
|
|
- } catch (final SQLException e) {
|
|
|
- throw new RuntimeException(e.getMessage(), e);
|
|
|
- }
|
|
|
- }
|
|
|
- return conn;
|
|
|
- }
|
|
|
}
|