Sync with L2jServer HighFive Jul 25th 2015.
This commit is contained in:
@ -27,7 +27,7 @@ import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.commons.database.pool.impl.ConnectionFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.util.Broadcast;
|
||||
|
||||
@ -96,17 +96,17 @@ public final class AutoAnnouncement extends Announcement implements Runnable
|
||||
@Override
|
||||
public boolean storeMe()
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement st = con.prepareStatement(INSERT_QUERY, Statement.RETURN_GENERATED_KEYS))
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(INSERT_QUERY, Statement.RETURN_GENERATED_KEYS))
|
||||
{
|
||||
st.setInt(1, getType().ordinal());
|
||||
st.setString(2, getContent());
|
||||
st.setString(3, getAuthor());
|
||||
st.setLong(4, getInitial());
|
||||
st.setLong(5, getDelay());
|
||||
st.setInt(6, getRepeat());
|
||||
st.execute();
|
||||
try (ResultSet rset = st.getGeneratedKeys())
|
||||
ps.setInt(1, getType().ordinal());
|
||||
ps.setString(2, getContent());
|
||||
ps.setString(3, getAuthor());
|
||||
ps.setLong(4, getInitial());
|
||||
ps.setLong(5, getDelay());
|
||||
ps.setInt(6, getRepeat());
|
||||
ps.execute();
|
||||
try (ResultSet rset = ps.getGeneratedKeys())
|
||||
{
|
||||
if (rset.next())
|
||||
{
|
||||
@ -125,17 +125,17 @@ public final class AutoAnnouncement extends Announcement implements Runnable
|
||||
@Override
|
||||
public boolean updateMe()
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement st = con.prepareStatement(UPDATE_QUERY))
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(UPDATE_QUERY))
|
||||
{
|
||||
st.setInt(1, getType().ordinal());
|
||||
st.setString(2, getContent());
|
||||
st.setString(3, getAuthor());
|
||||
st.setLong(4, getInitial());
|
||||
st.setLong(5, getDelay());
|
||||
st.setLong(6, getRepeat());
|
||||
st.setLong(7, getId());
|
||||
st.execute();
|
||||
ps.setInt(1, getType().ordinal());
|
||||
ps.setString(2, getContent());
|
||||
ps.setString(3, getAuthor());
|
||||
ps.setLong(4, getInitial());
|
||||
ps.setLong(5, getDelay());
|
||||
ps.setLong(6, getRepeat());
|
||||
ps.setLong(7, getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user