Code example for ResultSet

Methods: getInt, getString, getTimestamp

0
 */ 
public class RTTaskRowMapper implements RowMapper { 
    @Override 
    public Object mapRow(ResultSet rs, int index) throws SQLException{
        RealTimeTaskDAO task = new RealTimeTaskDAO();
        task.setTaskId(rs.getInt("TASK_ID"));
        task.setSequencecode(rs.getInt("SEQUENCE_CODE"));
        task.setLogicAddress(rs.getString("LOGICAL_ADDR"));
        task.setSendmsg(rs.getString("SEND_MSG"));
        task.setStatestatus(rs.getString("TASK_STATUS"));
        task.setGpMark(rs.getString("GP_MARK"));
        task.setCommandMark(rs.getString("COMMAND_MARK"));
        task.setPosttime(rs.getTimestamp("POST_TIME"));
        task.setTerminalProtocol(rs.getString("TERMINAL_PROTOCOL"));
        task.setMeterProtocol(rs.getString("METER_PROTOCOL"));
        return task;
    } 
 
}