Code example for ResultSetMetaData

Methods: getColumnCount

0
    } 
 
    // SQLException checking test fails 
    public void testGetColumnCount() { 
        try { 
            assertEquals(3, rsmd.getColumnCount());
        } catch (SQLException e) {
            fail("SQLException is thrown: " + e.getMessage());
        } 
 
        try { 
            rs.close();
            rsmd.getColumnCount();
            fail("Exception expected"); 
        } catch (SQLException e) {
            //ok 
        } 
 
    } 
 
    // Column label has format TABLE.COLUMN expected: COLUMN