Code example for SQLException

Methods: getMessage

0
    // not supported 
    public void testGetCatalogName() throws SQLException { 
        try { 
            assertNotNull(rsmd.getCatalogName(1));
        } catch (SQLException e) {
            fail("SQLException is thrown: " + e.getMessage());
        } 
 
        try { 
            conn.close(); 
            rsmd.getCatalogName(0);
            fail("Exception expected"); 
        } catch (SQLException e) {
            //ok 
        } 
    } 
 
    public void testGetColumnClassName() { 
        try { 
            assertNotNull(rsmd);
            assertEquals(Short.class.getName(), rsmd.getColumnClassName(1));