diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index 2e4191ca..449def09 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -165,8 +165,9 @@ public class dbBuildingHandler extends dbHandlerBase { preparedStatement.setString(3, String.valueOf(new_value)); ResultSet rs = preparedStatement.executeQuery(); - result = rs.getString("result"); + if (rs.next()) + result = rs.getString("result"); } catch (SQLException e) { Logger.error(e); diff --git a/src/engine/db/handlers/dbGuildHandler.java b/src/engine/db/handlers/dbGuildHandler.java index e625f939..bcbe6b30 100644 --- a/src/engine/db/handlers/dbGuildHandler.java +++ b/src/engine/db/handlers/dbGuildHandler.java @@ -439,6 +439,7 @@ public class dbGuildHandler extends dbHandlerBase { if (objectUUID > 0) guild = GET_GUILD(objectUUID); } + } catch (SQLException e) { Logger.error(e); } diff --git a/src/engine/db/handlers/dbItemHandler.java b/src/engine/db/handlers/dbItemHandler.java index 38b43943..8e6ffd95 100644 --- a/src/engine/db/handlers/dbItemHandler.java +++ b/src/engine/db/handlers/dbItemHandler.java @@ -101,6 +101,7 @@ public class dbItemHandler extends dbHandlerBase { if (objectUUID > 0) return GET_ITEM(objectUUID); } + } catch (SQLException e) { Logger.error(e); } diff --git a/src/engine/db/handlers/dbMobHandler.java b/src/engine/db/handlers/dbMobHandler.java index 0081f67e..e3d64b0a 100644 --- a/src/engine/db/handlers/dbMobHandler.java +++ b/src/engine/db/handlers/dbMobHandler.java @@ -63,6 +63,7 @@ public class dbMobHandler extends dbHandlerBase { if (objectUUID > 0) mobile = GET_MOB(objectUUID); } + } catch (SQLException e) { throw new RuntimeException(e); } @@ -238,7 +239,9 @@ public class dbMobHandler extends dbHandlerBase { preparedStatement.setString(3, String.valueOf(new_value)); ResultSet rs = preparedStatement.executeQuery(); - result = rs.getString("result"); + + if (rs.next()) + result = rs.getString("result"); } catch (SQLException e) { Logger.error(e); diff --git a/src/engine/db/handlers/dbNPCHandler.java b/src/engine/db/handlers/dbNPCHandler.java index b718ab25..6bfc9da8 100644 --- a/src/engine/db/handlers/dbNPCHandler.java +++ b/src/engine/db/handlers/dbNPCHandler.java @@ -62,6 +62,7 @@ public class dbNPCHandler extends dbHandlerBase { if (objectUUID > 0) npc = GET_NPC(objectUUID); } + } catch (SQLException e) { throw new RuntimeException(e); } @@ -160,7 +161,9 @@ public class dbNPCHandler extends dbHandlerBase { preparedStatement.setString(3, String.valueOf(new_value)); ResultSet rs = preparedStatement.executeQuery(); - result = rs.getString("result"); + + if (rs.next()) + result = rs.getString("result"); } catch (SQLException e) { Logger.error(e); diff --git a/src/engine/db/handlers/dbPlayerCharacterHandler.java b/src/engine/db/handlers/dbPlayerCharacterHandler.java index 99d771c4..59b48a78 100644 --- a/src/engine/db/handlers/dbPlayerCharacterHandler.java +++ b/src/engine/db/handlers/dbPlayerCharacterHandler.java @@ -62,12 +62,12 @@ public class dbPlayerCharacterHandler extends dbHandlerBase { ResultSet rs = preparedStatement.executeQuery(); if (rs.next()) { - int objectUUID = (int) rs.getLong("UID"); if (objectUUID > 0) playerCharacter = GET_PLAYER_CHARACTER(objectUUID); } + } catch (SQLException e) { Logger.error(e); } @@ -362,7 +362,9 @@ public class dbPlayerCharacterHandler extends dbHandlerBase { preparedStatement.setString(3, String.valueOf(new_value)); ResultSet rs = preparedStatement.executeQuery(); - result = rs.getString("result"); + + if (rs.next()) + result = rs.getString("result"); } catch (SQLException e) { Logger.error(e);