Closed resources in GalleryController

This commit is contained in:
Aleksei 2020-02-24 23:49:52 -05:00
parent 34d01f6934
commit d2b64760ce

View File

@ -64,13 +64,14 @@ public class GalleryController {
while (rs.next()) { while (rs.next()) {
galleries.add(mapObject(rs)); galleries.add(mapObject(rs));
} }
rs.getStatement().close(); FSDB.get().close(rs);
return galleries; return galleries;
} }
private static boolean galleryExistsExec(String channelId) throws SQLException { private static boolean galleryExistsExec(String channelId) throws SQLException {
ResultSet rs = FSDB.get().select("SELECT EXISTS(SELECT 1 FROM galleries WHERE channel_id = ?) AS hmm", channelId); ResultSet rs = FSDB.get().select("SELECT EXISTS(SELECT 1 FROM galleries WHERE channel_id = ?) AS hmm", channelId);
FSDB.get().close(rs);
return rs.getBoolean("hmm"); return rs.getBoolean("hmm");
} }