Code example for ResultSet

Methods: getInt, getString, next

0
    private String state;
    private String info;
 
    public MySQLProcessInfo(ResultSet result) throws SQLException {
        if (result == null) throw new IllegalArgumentException("result is null");
        if (result.next()) {
            id = result.getInt("Id");
            command = result.getString("Command");
            time = result.getString("Time");
            state = result.getString("State");
            info = result.getString("Info");
        } 
    } 
 
    public int getId() { 
        return id;
    } 
 
    public String getCommand() {
        return command;
    }