mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-02-16 10:30:58 +00:00
@@ -51,8 +51,12 @@ public class DatabaseCooldowns extends SQLite {
|
||||
}
|
||||
|
||||
public void removePlayer(UUID uuid, World world) {
|
||||
String sql = "DELETE FROM " + world.getName() + " WHERE "
|
||||
+ COLUMNS.UUID.name + " = ?";
|
||||
// Create SQL query string with backtick-ed table name to allow for special characters
|
||||
String sql = String.format(
|
||||
"DELETE FROM `%s` WHERE %s = ?",
|
||||
world.getName(),
|
||||
COLUMNS.UUID.name
|
||||
);
|
||||
List<Object> params = new ArrayList<Object>() {{
|
||||
add(uuid.toString());
|
||||
}};
|
||||
@@ -65,7 +69,12 @@ public class DatabaseCooldowns extends SQLite {
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
conn = getSQLConnection();
|
||||
ps = conn.prepareStatement("SELECT * FROM " + world.getName() + " WHERE " + COLUMNS.UUID.name + " = ?");
|
||||
// Create prepared statement with backtick-ed table name to allow for special characters
|
||||
ps = conn.prepareStatement(String.format(
|
||||
"SELECT * FROM `%s` WHERE %s = ?",
|
||||
world.getName(),
|
||||
COLUMNS.UUID.name
|
||||
));
|
||||
ps.setString(1, uuid.toString());
|
||||
|
||||
rs = ps.executeQuery();
|
||||
|
||||
Reference in New Issue
Block a user