I'm running into a pretty big bug on an SQL-based Bukkit plugin that uses PatPeter's SQLite Bukkit plugin "SQLibrary". I'm attempting to determine whether a player is already entered into the database using the first solution from another SO thread. More information can be found on this forum thread, but I'll give a brief outline here as well.
This is the stack trace:
And here is the suspect method, with the line indicated in the stack trace marked:
SQLite sqlite; // Set in plugin.onEnable(), which executes before anything
String QUERY_PLAYEREXISTS = "SELECT playername FROM table WHERE playername = ?";
...
public boolean exists(String name) throws SQLException {
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
boolean exists = false;
try {
connection = sqlite.getConnection();
statement = connection.prepareStatement(QUERY_PLAYEREXISTS); // 109
statement.setString(1, name.toLowerCase());
resultSet = statement.executeQuery();
exists = resultSet.next();
} finally {
connection.close();
statement.close();
resultSet.close();
}
return exists;
}
What's going on here?