Code example for ResultSet

Methods: getInt, getLong, getNString

0
public class EventMapper implements RowMapper<Event>{ 
 
	 
	public Event mapRow(ResultSet rs, int rowNum) throws SQLException {
 
		String fName = rs.getNString("patientFName");
		String lName = rs.getNString("patientLName");
		String title = fName+" "+lName;
		long examDuration = rs.getInt("roomScanDuration")*60;
		int patientStatus= rs.getInt("reservationPatientStatus");
		String color= "blue";
		String textColor= "white";
		 
		 
		DateFormat df = new SimpleDateFormat("YYYY-MM-dd hh:mm:ss");
		 
		Long startTimestamp = rs.getLong("reservationExamTime");
		Long endTimestamp = startTimestamp + examDuration;
		 
		String start = df.format(new Date((startTimestamp*1000)));
		String end = df.format(new Date ((endTimestamp*1000)));
		Integer roomId= rs.getInt("reservationRoomId");
		String url = "/RIS/reservation/edit?patientFName="+fName+"&patientLName="+
		lName+"&reservationRoomId="+roomId+"&reservationExamTime="+startTimestamp;
		 
		switch (patientStatus){
		case 0: