Explicitly set scrolling mode where ResultSet is used for scrolling
This commit is contained in:
@@ -9778,7 +9778,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
public void showNote() {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM notes WHERE `to` = ? AND `deleted` = 0", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE)) {
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM notes WHERE `to` = ? AND `deleted` = 0",
|
||||
ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE)) {
|
||||
ps.setString(1, this.getName());
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
rs.last();
|
||||
|
||||
@@ -247,9 +247,10 @@ public final class MonsterBook {
|
||||
public static int[] getCardTierSize() {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT COUNT(*) FROM monstercarddata GROUP BY floor(cardid / 1000);");
|
||||
PreparedStatement ps = con.prepareStatement("SELECT COUNT(*) FROM monstercarddata GROUP BY floor(cardid / 1000);",
|
||||
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
|
||||
rs.last();
|
||||
int[] tierSizes = new int[rs.getRow()];
|
||||
rs.beforeFirst();
|
||||
|
||||
@@ -1626,8 +1626,7 @@ public class Server {
|
||||
private static void applyAllWorldTransfers() {
|
||||
try (Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM worldtransfers WHERE completionTime IS NULL",
|
||||
ResultSet.TYPE_SCROLL_SENSITIVE,
|
||||
ResultSet.CONCUR_READ_ONLY)) {
|
||||
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)) {
|
||||
ResultSet rs = ps.executeQuery();
|
||||
List<Integer> removedTransfers = new LinkedList<Integer>();
|
||||
while(rs.next()) {
|
||||
|
||||
@@ -98,7 +98,8 @@ public final class BBSOperationHandler extends AbstractMaplePacketHandler {
|
||||
private static void listBBSThreads(MapleClient c, int start) {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM bbs_threads WHERE guildid = ? ORDER BY localthreadid DESC")) {
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM bbs_threads WHERE guildid = ? ORDER BY localthreadid DESC",
|
||||
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)) {
|
||||
ps.setInt(1, c.getPlayer().getGuildId());
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
c.announce(MaplePacketCreator.BBSThreadList(rs, start));
|
||||
|
||||
@@ -76,7 +76,7 @@ public class MapleGuild {
|
||||
con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM guilds WHERE guildid = " + guildid);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
if (!rs.first()) {
|
||||
if (!rs.next()) {
|
||||
id = -1;
|
||||
ps.close();
|
||||
rs.close();
|
||||
@@ -102,7 +102,7 @@ public class MapleGuild {
|
||||
ps = con.prepareStatement("SELECT id, name, level, job, guildrank, allianceRank FROM characters WHERE guildid = ? ORDER BY guildrank ASC, name ASC");
|
||||
ps.setInt(1, guildid);
|
||||
rs = ps.executeQuery();
|
||||
if (!rs.first()) {
|
||||
if (!rs.next()) {
|
||||
rs.close();
|
||||
ps.close();
|
||||
return;
|
||||
@@ -436,7 +436,7 @@ public class MapleGuild {
|
||||
PreparedStatement ps = con.prepareStatement("SELECT guildid FROM guilds WHERE name = ?");
|
||||
ps.setString(1, name);
|
||||
ResultSet rs = ps.executeQuery();
|
||||
if (rs.first()) {
|
||||
if (rs.next()) {
|
||||
ps.close();
|
||||
rs.close();
|
||||
return 0;
|
||||
@@ -454,7 +454,7 @@ public class MapleGuild {
|
||||
ps = con.prepareStatement("SELECT guildid FROM guilds WHERE leader = ?");
|
||||
ps.setInt(1, leaderId);
|
||||
rs = ps.executeQuery();
|
||||
rs.first();
|
||||
rs.next();
|
||||
int guildId = rs.getInt("guildid");
|
||||
rs.close();
|
||||
ps.close();
|
||||
@@ -779,7 +779,8 @@ public class MapleGuild {
|
||||
try {
|
||||
ResultSet rs;
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT `name`, `GP`, `logoBG`, `logoBGColor`, `logo`, `logoColor` FROM guilds ORDER BY `GP` DESC LIMIT 50")) {
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT `name`, `GP`, `logoBG`, `logoBGColor`, `logo`, `logoColor` FROM guilds ORDER BY `GP` DESC LIMIT 50",
|
||||
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)) {
|
||||
rs = ps.executeQuery();
|
||||
c.announce(MaplePacketCreator.showGuildRanks(npcid, rs));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user