public void testNetworkTimeout() throws Exception {
con = TestUtil.openDB();
assertEquals(0, con.getNetworkTimeout());
con.setNetworkTimeout(null, 1000);
assertEquals(1000, con.getNetworkTimeout());
<BUG>try (Statement stmt = con.createStatement()) {
</BUG>
try {
stmt.execute("SELECT pg_sleep(10);");
fail("Expected SQLTimeoutException");

public void testNetworkTimeout() throws Exception {
con = TestUtil.openDB();
assertEquals(0, con.getNetworkTimeout());
con.setNetworkTimeout(null, 1000);
assertEquals(1000, con.getNetworkTimeout());
Statement stmt = con.createStatement();
try {
stmt.execute("SELECT pg_sleep(10);");
fail("Expected SQLTimeoutException");
