Browse Source

bug class fixed involving rs usage

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

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

@ -165,8 +165,9 @@ public class dbBuildingHandler extends dbHandlerBase {
preparedStatement.setString(3, String.valueOf(new_value)); preparedStatement.setString(3, String.valueOf(new_value));
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
result = rs.getString("result");
if (rs.next())
result = rs.getString("result");
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);

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

@ -439,6 +439,7 @@ public class dbGuildHandler extends dbHandlerBase {
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);
} }

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

@ -101,6 +101,7 @@ public class dbItemHandler extends dbHandlerBase {
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);
} }

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

@ -63,6 +63,7 @@ public class dbMobHandler extends dbHandlerBase {
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);
} }
@ -238,7 +239,9 @@ public class dbMobHandler extends dbHandlerBase {
preparedStatement.setString(3, String.valueOf(new_value)); preparedStatement.setString(3, String.valueOf(new_value));
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
result = rs.getString("result");
if (rs.next())
result = rs.getString("result");
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);

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

@ -62,6 +62,7 @@ public class dbNPCHandler extends dbHandlerBase {
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);
} }
@ -160,7 +161,9 @@ public class dbNPCHandler extends dbHandlerBase {
preparedStatement.setString(3, String.valueOf(new_value)); preparedStatement.setString(3, String.valueOf(new_value));
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
result = rs.getString("result");
if (rs.next())
result = rs.getString("result");
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);

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

@ -62,12 +62,12 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) { 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);
} }
@ -362,7 +362,9 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
preparedStatement.setString(3, String.valueOf(new_value)); preparedStatement.setString(3, String.valueOf(new_value));
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
result = rs.getString("result");
if (rs.next())
result = rs.getString("result");
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);

Loading…
Cancel
Save