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() {
|
public void showNote() {
|
||||||
try {
|
try {
|
||||||
Connection con = DatabaseConnection.getConnection();
|
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());
|
ps.setString(1, this.getName());
|
||||||
try (ResultSet rs = ps.executeQuery()) {
|
try (ResultSet rs = ps.executeQuery()) {
|
||||||
rs.last();
|
rs.last();
|
||||||
|
|||||||
@@ -247,7 +247,8 @@ public final class MonsterBook {
|
|||||||
public static int[] getCardTierSize() {
|
public static int[] getCardTierSize() {
|
||||||
try {
|
try {
|
||||||
Connection con = DatabaseConnection.getConnection();
|
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();
|
ResultSet rs = ps.executeQuery();
|
||||||
|
|
||||||
rs.last();
|
rs.last();
|
||||||
|
|||||||
@@ -1626,8 +1626,7 @@ public class Server {
|
|||||||
private static void applyAllWorldTransfers() {
|
private static void applyAllWorldTransfers() {
|
||||||
try (Connection con = DatabaseConnection.getConnection();
|
try (Connection con = DatabaseConnection.getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM worldtransfers WHERE completionTime IS NULL",
|
PreparedStatement ps = con.prepareStatement("SELECT * FROM worldtransfers WHERE completionTime IS NULL",
|
||||||
ResultSet.TYPE_SCROLL_SENSITIVE,
|
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)) {
|
||||||
ResultSet.CONCUR_READ_ONLY)) {
|
|
||||||
ResultSet rs = ps.executeQuery();
|
ResultSet rs = ps.executeQuery();
|
||||||
List<Integer> removedTransfers = new LinkedList<Integer>();
|
List<Integer> removedTransfers = new LinkedList<Integer>();
|
||||||
while(rs.next()) {
|
while(rs.next()) {
|
||||||
|
|||||||
@@ -98,7 +98,8 @@ public final class BBSOperationHandler extends AbstractMaplePacketHandler {
|
|||||||
private static void listBBSThreads(MapleClient c, int start) {
|
private static void listBBSThreads(MapleClient c, int start) {
|
||||||
try {
|
try {
|
||||||
Connection con = DatabaseConnection.getConnection();
|
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());
|
ps.setInt(1, c.getPlayer().getGuildId());
|
||||||
try (ResultSet rs = ps.executeQuery()) {
|
try (ResultSet rs = ps.executeQuery()) {
|
||||||
c.announce(MaplePacketCreator.BBSThreadList(rs, start));
|
c.announce(MaplePacketCreator.BBSThreadList(rs, start));
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class MapleGuild {
|
|||||||
con = DatabaseConnection.getConnection();
|
con = DatabaseConnection.getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM guilds WHERE guildid = " + guildid);
|
PreparedStatement ps = con.prepareStatement("SELECT * FROM guilds WHERE guildid = " + guildid);
|
||||||
ResultSet rs = ps.executeQuery();
|
ResultSet rs = ps.executeQuery();
|
||||||
if (!rs.first()) {
|
if (!rs.next()) {
|
||||||
id = -1;
|
id = -1;
|
||||||
ps.close();
|
ps.close();
|
||||||
rs.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 = con.prepareStatement("SELECT id, name, level, job, guildrank, allianceRank FROM characters WHERE guildid = ? ORDER BY guildrank ASC, name ASC");
|
||||||
ps.setInt(1, guildid);
|
ps.setInt(1, guildid);
|
||||||
rs = ps.executeQuery();
|
rs = ps.executeQuery();
|
||||||
if (!rs.first()) {
|
if (!rs.next()) {
|
||||||
rs.close();
|
rs.close();
|
||||||
ps.close();
|
ps.close();
|
||||||
return;
|
return;
|
||||||
@@ -436,7 +436,7 @@ public class MapleGuild {
|
|||||||
PreparedStatement ps = con.prepareStatement("SELECT guildid FROM guilds WHERE name = ?");
|
PreparedStatement ps = con.prepareStatement("SELECT guildid FROM guilds WHERE name = ?");
|
||||||
ps.setString(1, name);
|
ps.setString(1, name);
|
||||||
ResultSet rs = ps.executeQuery();
|
ResultSet rs = ps.executeQuery();
|
||||||
if (rs.first()) {
|
if (rs.next()) {
|
||||||
ps.close();
|
ps.close();
|
||||||
rs.close();
|
rs.close();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -454,7 +454,7 @@ public class MapleGuild {
|
|||||||
ps = con.prepareStatement("SELECT guildid FROM guilds WHERE leader = ?");
|
ps = con.prepareStatement("SELECT guildid FROM guilds WHERE leader = ?");
|
||||||
ps.setInt(1, leaderId);
|
ps.setInt(1, leaderId);
|
||||||
rs = ps.executeQuery();
|
rs = ps.executeQuery();
|
||||||
rs.first();
|
rs.next();
|
||||||
int guildId = rs.getInt("guildid");
|
int guildId = rs.getInt("guildid");
|
||||||
rs.close();
|
rs.close();
|
||||||
ps.close();
|
ps.close();
|
||||||
@@ -779,7 +779,8 @@ public class MapleGuild {
|
|||||||
try {
|
try {
|
||||||
ResultSet rs;
|
ResultSet rs;
|
||||||
Connection con = DatabaseConnection.getConnection();
|
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();
|
rs = ps.executeQuery();
|
||||||
c.announce(MaplePacketCreator.showGuildRanks(npcid, rs));
|
c.announce(MaplePacketCreator.showGuildRanks(npcid, rs));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user