Code example for Statement

Methods: executegetResultSet

0
        try { 
            conn.setAutoCommit(false); 
            assertFalse(conn.getAutoCommit()); 
            String query = "select * from zoo";
            st = conn.createStatement();
            st.execute(query);
            rs = st.getResultSet();
            rsmd = rs.getMetaData();
        } catch (SQLException e) {
            fail("Couldn't get ResultSetMetaData object"); 
        } 
    } 
 
    @Override 
    public void tearDown() throws SQLException { 
        try { 
            rs.close();
            st.close();
        } catch (SQLException e) {
            fail("Couldn't close Statement object");