Code example for Statement

Methods: execute, getResultSet

0
        ResultSet rs = null;
        ResultSet a;
        try { 
            FlowControl.requires(conn != null && conn.isValid(100));
            Statement stmt = conn.createStatement();
            if (stmt.execute(SQLCmd)) {
                rs = stmt.getResultSet();
            } 
        } 
        catch (SQLException ex){
            // handle any errors 
            System.out.println("SQLException: " + ex.getMessage());
            System.out.println("SQLState: " + ex.getSQLState());
            System.out.println("VendorError: " + ex.getErrorCode());
        } finally { 
            return rs;
        } 
    } 
}