Refactored DatabaseFactory.
This commit is contained in:
@@ -24,7 +24,7 @@ import java.sql.Statement;
|
||||
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
|
||||
@@ -108,7 +108,7 @@ public class Announcement implements IAnnouncement
|
||||
@Override
|
||||
public boolean storeMe()
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(INSERT_QUERY, Statement.RETURN_GENERATED_KEYS))
|
||||
{
|
||||
ps.setInt(1, _type.ordinal());
|
||||
@@ -134,7 +134,7 @@ public class Announcement implements IAnnouncement
|
||||
@Override
|
||||
public boolean updateMe()
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(UPDATE_QUERY))
|
||||
{
|
||||
ps.setInt(1, _type.ordinal());
|
||||
@@ -154,7 +154,7 @@ public class Announcement implements IAnnouncement
|
||||
@Override
|
||||
public boolean deleteMe()
|
||||
{
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(DELETE_QUERY))
|
||||
{
|
||||
ps.setInt(1, _id);
|
||||
|
Reference in New Issue
Block a user