Skip to content

Commit

Permalink
Close JDBC Connection in test [HZ-3617]
Browse files Browse the repository at this point in the history
  • Loading branch information
orcunc committed Dec 12, 2023
1 parent d30c480 commit 9a6f973
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
class JdbcDataBaseMetadataTest {

private static final String JDBC_HAZELCAST_LOCALHOST = "jdbc:hazelcast://localhost:5701/";

private static Connection connection;

private static DatabaseMetaData dbMetaData;

@BeforeAll
Expand All @@ -60,12 +63,14 @@ public static void setUp() throws SQLException {
SqlResult sqlResult = member.getSql()
.execute("create view emp_dept_view as select * from emp join dept on emp.age=dept.__key");
sqlResult.close();
Connection connection = DriverManager.getConnection(JDBC_HAZELCAST_LOCALHOST);
connection = DriverManager.getConnection(JDBC_HAZELCAST_LOCALHOST);
dbMetaData = connection.getMetaData();
}

@AfterAll
public static void tearDown() {
public static void tearDown() throws SQLException {
connection.close();

HazelcastClient.shutdownAll();
Hazelcast.shutdownAll();
}
Expand Down

0 comments on commit 9a6f973

Please sign in to comment.