Dropped c3p0 in favor of HikariCP.
This commit is contained in:
@ -43,6 +43,7 @@ public class SQLAccountManager
|
||||
{
|
||||
Server.serverMode = Server.MODE_LOGINSERVER;
|
||||
Config.load();
|
||||
DatabaseFactory.init();
|
||||
|
||||
try (Scanner _scn = new Scanner(System.in))
|
||||
{
|
||||
@ -166,7 +167,7 @@ public class SQLAccountManager
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
ResultSet rset = ps.executeQuery())
|
||||
{
|
||||
@ -187,7 +188,7 @@ public class SQLAccountManager
|
||||
|
||||
private static void addOrUpdateAccount(String account, String password, String level)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("REPLACE accounts(login, password, accessLevel) VALUES (?, ?, ?)"))
|
||||
{
|
||||
final MessageDigest md = MessageDigest.getInstance("SHA");
|
||||
@ -213,7 +214,7 @@ public class SQLAccountManager
|
||||
|
||||
private static void changeAccountLevel(String account, String level)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE accounts SET accessLevel = ? WHERE login = ?"))
|
||||
{
|
||||
ps.setString(1, level);
|
||||
@ -236,7 +237,7 @@ public class SQLAccountManager
|
||||
|
||||
private static void deleteAccount(String account)
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM accounts WHERE login = ?"))
|
||||
{
|
||||
ps.setString(1, account);
|
||||
|
@ -34,7 +34,7 @@ public class DBInstallerConsole implements DBOutputInterface
|
||||
|
||||
public DBInstallerConsole(String db, String dir) throws Exception
|
||||
{
|
||||
System.out.println("Welcome to L2J DataBase installer");
|
||||
System.out.println("Welcome to DataBase installer");
|
||||
final Preferences prop = Preferences.userRoot();
|
||||
RunTasks rt = null;
|
||||
try (Scanner scn = new Scanner(new CloseShieldedInputStream(System.in)))
|
||||
|
@ -187,6 +187,7 @@ public abstract class BaseGameServerRegister
|
||||
Server.serverMode = Server.MODE_LOGINSERVER;
|
||||
|
||||
Config.load();
|
||||
DatabaseFactory.init();
|
||||
GameServerTable.getInstance();
|
||||
|
||||
_loaded = true;
|
||||
@ -215,7 +216,7 @@ public abstract class BaseGameServerRegister
|
||||
*/
|
||||
public static void unregisterGameServer(int id) throws SQLException
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM gameservers WHERE server_id = ?"))
|
||||
|
||||
{
|
||||
@ -231,7 +232,7 @@ public abstract class BaseGameServerRegister
|
||||
*/
|
||||
public static void unregisterAllGameServers() throws SQLException
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
Statement s = con.createStatement())
|
||||
{
|
||||
s.executeUpdate("DELETE FROM gameservers");
|
||||
|
Reference in New Issue
Block a user