Connection dialect1Connection = DriverManager.getConnection(DB_DRIVER_URL, info);  Statement stmt = dialect1Connection.createStatement();
try {  Connection dialect1Connection = DriverManager.getConnection(DB_DRIVER_URL, info);  Statement stmt = dialect1Connection.createStatement();    stmt.executeQuery("SELECT 1 as col1 FROM rdb$database");  stmt.close();  SQLWarning warning = dialect1Connection.getWarnings();  assertTrue("Connection should have at least one warning.", warning != null);  dialect1Connection.clearWarnings();  assertTrue("After clearing no warnings should be present.", dialect1Connection.getWarnings() == null);  dialect1Connection.close(); } finally {
    public void testWarnings() throws Exception {        Properties info = (Properties)DB_INFO.clone();        info.setProperty("set_db_sql_dialect", "1");                // open connection and convert DB to SQL dialect 1        Connection dialect1Connection =             DriverManager.getConnection(DB_DRIVER_URL, info);                    Statement stmt = dialect1Connection.createStatement();                // execute select statement, driver will pass SQL dialect 3         // for this statement and database server will return a warning        stmt.executeQuery("SELECT 1 as col1 FROM rdb$database");                stmt.close();                SQLWarning warning = dialect1Connection.getWarnings();                assertTrue("Connection should have at least one warning.",             warning != null);                    dialect1Connection.clearWarnings();                assertTrue("After clearing no warnings should be present.",            dialect1Connection.getWarnings() == null);                    dialect1Connection.close();                info.setProperty("set_db_sql_dialect", "3");                Connection dialect3Connection =             DriverManager.getConnection(DB_DRIVER_URL, info);                    dialect3Connection.close();    }