fix: adding close statements
@@ -37,6 +37,7 @@ public final class SqlConnectionRule extends ExternalResource {
try (Statement stmt = connection.createStatement()) {
stmt.execute("DROP table NAME0");
stmt.execute("DROP table ADDRESS0");
+ stmt.close();
connection.close();
} catch (final SQLException e) {
throw new AssertionError("Exception during database cleanup.", e);
@@ -61,6 +62,7 @@ public final class SqlConnectionRule extends ExternalResource {
try (Statement stmt = connection.createStatement()) {
stmt.executeUpdate("CREATE TABLE name0 (id INTEGER PRIMARY KEY, firstName VARCHAR(255), " + "lastName VARCHAR(255))");
stmt.executeUpdate("CREATE TABLE ADDRESS0 (id INTEGER PRIMARY KEY, Address VARCHAR(255), " + "lastName VARCHAR(255))");
+ stmt.close();
}
} catch (final SQLException e) {
throw new AssertionError("Exception during database startup.", e);
