Refactored DatabaseFactory.

This commit is contained in:
MobiusDev
2016-01-11 21:31:45 +00:00
parent d288d505a9
commit 2684901232
140 changed files with 668 additions and 955 deletions

View File

@@ -25,7 +25,7 @@ import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.commons.database.pool.impl.ConnectionFactory;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.loginserver.GameServerTable;
import com.l2jmobius.loginserver.GameServerTable.GameServerInfo;
import com.l2jmobius.loginserver.GameServerThread;
@@ -80,7 +80,7 @@ public class ChangePassword extends BaseRecievePacket
int passUpdated = 0;
// SQL connection
try (Connection con = ConnectionFactory.getInstance().getConnection();
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("SELECT password FROM accounts WHERE login=?"))
{
ps.setString(1, accountName);
@@ -99,7 +99,7 @@ public class ChangePassword extends BaseRecievePacket
password = md.digest(password);
// SQL connection
try (Connection con = ConnectionFactory.getInstance().getConnection();
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE accounts SET password=? WHERE login=?"))
{
ps.setString(1, Base64.getEncoder().encodeToString(password));

View File

@@ -22,7 +22,7 @@ import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.logging.Logger;
import com.l2jmobius.commons.database.pool.impl.ConnectionFactory;
import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.loginserver.LoginController;
import com.l2jmobius.util.network.BaseRecievePacket;
@@ -58,7 +58,7 @@ public class RequestTempBan extends BaseRecievePacket
private void banUser()
{
try (Connection con = ConnectionFactory.getInstance().getConnection();
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO account_data VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE value=?"))
{
ps.setString(1, _accountName);