Refactored DatabaseFactory.
This commit is contained in:
@@ -24,7 +24,7 @@ import java.util.Map.Entry;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.commons.database.pool.impl.ConnectionFactory;
|
||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
@@ -50,7 +50,7 @@ public class AccountVariables extends AbstractVariables
|
||||
public boolean restoreMe()
|
||||
{
|
||||
// Restore previous variables.
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement st = con.prepareStatement(SELECT_QUERY))
|
||||
{
|
||||
st.setString(1, _accountName);
|
||||
@@ -83,7 +83,7 @@ public class AccountVariables extends AbstractVariables
|
||||
return false;
|
||||
}
|
||||
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection())
|
||||
{
|
||||
// Clear previous entries.
|
||||
try (PreparedStatement st = con.prepareStatement(DELETE_QUERY))
|
||||
@@ -120,7 +120,7 @@ public class AccountVariables extends AbstractVariables
|
||||
@Override
|
||||
public boolean deleteMe()
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection())
|
||||
{
|
||||
// Clear previous entries.
|
||||
try (PreparedStatement st = con.prepareStatement(DELETE_QUERY))
|
||||
|
@@ -24,7 +24,7 @@ import java.util.Map.Entry;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jmobius.commons.database.pool.impl.ConnectionFactory;
|
||||
import com.l2jmobius.commons.database.DatabaseFactory;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
@@ -55,7 +55,7 @@ public class ItemVariables extends AbstractVariables
|
||||
public static boolean hasVariables(int objectId)
|
||||
{
|
||||
// Restore previous variables.
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement st = con.prepareStatement(SELECT_COUNT))
|
||||
{
|
||||
st.setInt(1, objectId);
|
||||
@@ -79,7 +79,7 @@ public class ItemVariables extends AbstractVariables
|
||||
public boolean restoreMe()
|
||||
{
|
||||
// Restore previous variables.
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement st = con.prepareStatement(SELECT_QUERY))
|
||||
{
|
||||
st.setInt(1, _objectId);
|
||||
@@ -112,7 +112,7 @@ public class ItemVariables extends AbstractVariables
|
||||
return false;
|
||||
}
|
||||
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection())
|
||||
{
|
||||
// Clear previous entries.
|
||||
try (PreparedStatement st = con.prepareStatement(DELETE_QUERY))
|
||||
@@ -149,7 +149,7 @@ public class ItemVariables extends AbstractVariables
|
||||
@Override
|
||||
public boolean deleteMe()
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection())
|
||||
{
|
||||
// Clear previous entries.
|
||||
try (PreparedStatement st = con.prepareStatement(DELETE_QUERY))
|
||||
|
@@ -24,7 +24,7 @@ import java.util.Map.Entry;
|
||||
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.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class PlayerVariables extends AbstractVariables
|
||||
public boolean restoreMe()
|
||||
{
|
||||
// Restore previous variables.
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(SELECT_QUERY))
|
||||
{
|
||||
ps.setInt(1, _objectId);
|
||||
@@ -85,7 +85,7 @@ public class PlayerVariables extends AbstractVariables
|
||||
return false;
|
||||
}
|
||||
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection())
|
||||
{
|
||||
// Clear previous entries.
|
||||
try (PreparedStatement st = con.prepareStatement(DELETE_QUERY))
|
||||
@@ -122,7 +122,7 @@ public class PlayerVariables extends AbstractVariables
|
||||
@Override
|
||||
public boolean deleteMe()
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection())
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection())
|
||||
{
|
||||
// Clear previous entries.
|
||||
try (PreparedStatement st = con.prepareStatement(DELETE_QUERY))
|
||||
|
Reference in New Issue
Block a user