Browse Source

Refactor to remove abstraction.

master
MagicBot 2 years ago
parent
commit
fce67a6bae
  1. 17
      src/engine/db/handlers/dbSkillBaseHandler.java

17
src/engine/db/handlers/dbSkillBaseHandler.java

@ -17,6 +17,8 @@ import engine.objects.MaxSkills; @@ -17,6 +17,8 @@ import engine.objects.MaxSkills;
import engine.objects.SkillsBase;
import org.pmw.tinylog.Logger;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
@ -110,13 +112,12 @@ public class dbSkillBaseHandler extends dbHandlerBase { @@ -110,13 +112,12 @@ public class dbSkillBaseHandler extends dbHandlerBase {
public void LOAD_ALL_RUNE_SKILLS() {
prepareCallable("SELECT * FROM `static_skill_skillsgranted`");
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_skill_skillsgranted`")) {
try {
ResultSet rs = executeQuery();
ResultSet rs = preparedStatement.executeQuery();
//shrines cached in rs for easy cache on creation.
while (rs.next()) {
int runeID = rs.getInt("runeID");
@ -129,15 +130,9 @@ public class dbSkillBaseHandler extends dbHandlerBase { @@ -129,15 +130,9 @@ public class dbSkillBaseHandler extends dbHandlerBase {
SkillsBase.runeSkillsCache.get(runeID).put(token, amount);
}
} catch (SQLException e) {
Logger.error( e.getErrorCode() + ' ' + e.getMessage(), e);
} finally {
closeCallable();
Logger.error(e);
}
}
}

Loading…
Cancel
Save