Put several queries in try-finally blocks

this prevents leaks
This commit is contained in:
James Seibel
2025-01-14 07:03:12 -06:00
parent 8b88816499
commit 1913e09303
4 changed files with 98 additions and 84 deletions
@@ -48,9 +48,10 @@ public class TestCompoundKeyRepo extends AbstractDhRepo<DhChunkPos, TestCompound
"\n" +
",PRIMARY KEY (XPos, ZPos)" +
");";
try (PreparedStatement createTableStatement = this.createPreparedStatement(createTableSql))
try (PreparedStatement createTableStatement = this.createPreparedStatement(createTableSql);
ResultSet result = this.query(createTableStatement))
{
this.query(createTableStatement);
}
}
@@ -46,9 +46,10 @@ public class TestPrimaryKeyRepo extends AbstractDhRepo<Integer, TestSingleKeyDto
",LongValue BIGINT NULL\n" +
",ByteValue TINYINT NULL\n" +
");";
try (PreparedStatement createTableStatement = this.createPreparedStatement(createTableSql))
try (PreparedStatement createTableStatement = this.createPreparedStatement(createTableSql);
ResultSet result = this.query(createTableStatement))
{
this.query(createTableStatement);
}
}