Browse Source

fix: bug class involving rs usage.

master
MagicBot 2 years ago
parent
commit
ad99415679
  1. 2
      src/engine/db/handlers/dbBuildingHandler.java
  2. 3
      src/engine/db/handlers/dbGuildHandler.java
  3. 3
      src/engine/db/handlers/dbItemHandler.java
  4. 3
      src/engine/db/handlers/dbMobHandler.java
  5. 3
      src/engine/db/handlers/dbNPCHandler.java
  6. 4
      src/engine/db/handlers/dbPlayerCharacterHandler.java

2
src/engine/db/handlers/dbBuildingHandler.java

@ -69,10 +69,12 @@ public class dbBuildingHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID"); int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0) if (objectUUID > 0)
building = GET_BUILDINGBYUUID(objectUUID); building = GET_BUILDINGBYUUID(objectUUID);
}
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);

3
src/engine/db/handlers/dbGuildHandler.java

@ -433,11 +433,12 @@ public class dbGuildHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID"); int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0) if (objectUUID > 0)
guild = GET_GUILD(objectUUID); guild = GET_GUILD(objectUUID);
}
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }

3
src/engine/db/handlers/dbItemHandler.java

@ -95,11 +95,12 @@ public class dbItemHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID"); int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0) if (objectUUID > 0)
return GET_ITEM(objectUUID); return GET_ITEM(objectUUID);
}
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }

3
src/engine/db/handlers/dbMobHandler.java

@ -57,11 +57,12 @@ public class dbMobHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID"); int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0) if (objectUUID > 0)
mobile = GET_MOB(objectUUID); mobile = GET_MOB(objectUUID);
}
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

3
src/engine/db/handlers/dbNPCHandler.java

@ -56,11 +56,12 @@ public class dbNPCHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID"); int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0) if (objectUUID > 0)
npc = GET_NPC(objectUUID); npc = GET_NPC(objectUUID);
}
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

4
src/engine/db/handlers/dbPlayerCharacterHandler.java

@ -61,11 +61,13 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) {
int objectUUID = (int) rs.getLong("UID"); int objectUUID = (int) rs.getLong("UID");
if (objectUUID > 0) if (objectUUID > 0)
playerCharacter = GET_PLAYER_CHARACTER(objectUUID); playerCharacter = GET_PLAYER_CHARACTER(objectUUID);
}
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }

Loading…
Cancel
Save