mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 13:26:56 +00:00
fixed couple of issues
This commit is contained in:
@@ -41,16 +41,12 @@ public class DatabaseSQLite {
|
||||
try {
|
||||
conn = DriverManager.getConnection(url);
|
||||
System.out.println("Connection to SQLite has been established.");
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
return true;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
System.out.println(e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
System.out.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -72,8 +68,9 @@ public class DatabaseSQLite {
|
||||
String sql = "SELECT * FROM `players` WHERE `player_uuid` = '" + uuid.toString() + "';";
|
||||
statement.execute(sql);
|
||||
ResultSet result = statement.getResultSet();
|
||||
boolean state = result.getBoolean("pvpenabled");
|
||||
conn.close();
|
||||
return new PlayerData(result.getBoolean("pvpenabled"));
|
||||
return new PlayerData(state);
|
||||
} catch (SQLException throwables) {
|
||||
throwables.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user