Refactored DatabaseFactory.
This commit is contained in:
@@ -36,7 +36,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.database.pool.impl.ConnectionFactory;
|
||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
import com.l2jmobius.gameserver.model.CursedWeapon;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
@@ -170,7 +170,7 @@ public final class CursedWeaponsManager
|
||||
|
||||
private final void restore()
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
Statement s = con.createStatement();
|
||||
ResultSet rs = s.executeQuery("SELECT itemId, charId, playerKarma, playerPkKills, nbKills, endTime FROM cursed_weapons"))
|
||||
{
|
||||
@@ -203,7 +203,7 @@ public final class CursedWeaponsManager
|
||||
// or a lost-child entry in the cursed weapons table, without a corresponding one in items...
|
||||
|
||||
// Retrieve the L2PcInstance from the characters table of the database
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT owner_id FROM items WHERE item_id=?"))
|
||||
{
|
||||
for (CursedWeapon cw : _cursedWeapons.values())
|
||||
@@ -369,7 +369,7 @@ public final class CursedWeaponsManager
|
||||
|
||||
public static void removeFromDb(int itemId)
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM cursed_weapons WHERE itemId = ?"))
|
||||
{
|
||||
ps.setInt(1, itemId);
|
||||
|
Reference in New Issue
Block a user