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

@ -23,7 +23,7 @@ import java.util.Calendar;
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.idfactory.IdFactory;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@ -45,7 +45,7 @@ public class Couple
{
_Id = coupleId;
try (Connection con = ConnectionFactory.getInstance().getConnection();
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("SELECT * FROM mods_wedding WHERE id = ?"))
{
ps.setInt(1, _Id);
@ -85,7 +85,7 @@ public class Couple
_weddingDate = Calendar.getInstance();
_weddingDate.setTimeInMillis(Calendar.getInstance().getTimeInMillis());
try (Connection con = ConnectionFactory.getInstance().getConnection();
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO mods_wedding (id, player1Id, player2Id, married, affianceDate, weddingDate) VALUES (?, ?, ?, ?, ?, ?)"))
{
_Id = IdFactory.getInstance().getNextId();
@ -105,7 +105,7 @@ public class Couple
public void marry()
{
try (Connection con = ConnectionFactory.getInstance().getConnection();
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE mods_wedding set married = ?, weddingDate = ? where id = ?"))
{
ps.setBoolean(1, true);
@ -123,7 +123,7 @@ public class Couple
public void divorce()
{
try (Connection con = ConnectionFactory.getInstance().getConnection();
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM mods_wedding WHERE id=?"))
{
ps.setInt(1, _Id);