You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -163,9 +155,8 @@ public BigInteger getDeaths(@NonNull UUID uuid) {
163
155
164
156
publicStringgetName(@NonNullUUIDuuid) {
165
157
166
-
try {
167
-
168
-
PreparedStatementps = plugin.sql.getConnection().prepareStatement("SELECT name FROM kill_death_data WHERE uuid=?");
158
+
try(Connectionconn = plugin.sql.getConnection();
159
+
PreparedStatementps = conn.prepareStatement("SELECT name FROM kill_death_data WHERE uuid=?")) {
169
160
ps.setString(1, uuid.toString());
170
161
171
162
ResultSetresult = ps.executeQuery();
@@ -175,6 +166,7 @@ public String getName(@NonNull UUID uuid) {
175
166
}
176
167
177
168
ps.close();
169
+
result.close();
178
170
179
171
returnnull;
180
172
@@ -212,10 +204,8 @@ public long getLastUpdated(@NonNull UUID uuid) {
212
204
}
213
205
214
206
publicResultSetgetRawData(@NonNullUUIDuuid) {
215
-
216
-
PreparedStatementps;
217
-
try {
218
-
ps = plugin.sql.getConnection().prepareStatement("SELECT * FROM kill_death_data WHERE uuid=?");
207
+
try(Connectionconn = plugin.sql.getConnection();
208
+
PreparedStatementps = conn.prepareStatement("SELECT * FROM kill_death_data WHERE uuid=?")) {
219
209
ps.setString(1, uuid.toString());
220
210
returnps.executeQuery();
221
211
} catch (SQLExceptionthrowables) {
@@ -227,7 +217,8 @@ public ResultSet getRawData(@NonNull UUID uuid) {
227
217
publicstaticfinalStringRANK_QUERY = "SELECT * FROM (SELECT uuid, ?, last_updated, RANK() over (ORDER BY ? DESC) as 'rank' FROM kill_death_data WHERE last_updated > ?) s WHERE s.uuid=?";
0 commit comments