fix: bug class involving rs usage.

This commit is contained in:
2023-05-23 12:24:11 -04:00
parent 568b0291a2
commit ad99415679
6 changed files with 30 additions and 22 deletions
@@ -69,10 +69,12 @@ public class dbBuildingHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery();
int objectUUID = (int) rs.getLong("UID");
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
building = GET_BUILDINGBYUUID(objectUUID);
if (objectUUID > 0)
building = GET_BUILDINGBYUUID(objectUUID);
}
} catch (SQLException e) {
throw new RuntimeException(e);
+5 -4
View File
@@ -433,11 +433,12 @@ public class dbGuildHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery();
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
guild = GET_GUILD(objectUUID);
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
guild = GET_GUILD(objectUUID);
}
} catch (SQLException e) {
Logger.error(e);
}
+5 -4
View File
@@ -95,11 +95,12 @@ public class dbItemHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery();
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
return GET_ITEM(objectUUID);
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
return GET_ITEM(objectUUID);
}
} catch (SQLException e) {
Logger.error(e);
}
+5 -4
View File
@@ -57,11 +57,12 @@ public class dbMobHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery();
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
mobile = GET_MOB(objectUUID);
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
mobile = GET_MOB(objectUUID);
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
+5 -4
View File
@@ -56,11 +56,12 @@ public class dbNPCHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery();
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
npc = GET_NPC(objectUUID);
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
npc = GET_NPC(objectUUID);
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
@@ -61,11 +61,13 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery();
int objectUUID = (int) rs.getLong("UID");
if (rs.next()) {
if (objectUUID > 0)
playerCharacter = GET_PLAYER_CHARACTER(objectUUID);
int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0)
playerCharacter = GET_PLAYER_CHARACTER(objectUUID);
}
} catch (SQLException e) {
Logger.error(e);
}