Code example for ResultSet

Methods: getInt, getObject, getTimestamp

0
public class DataObjectMapper { 
 
	@NotNull 
	public static DataObject mapRow(@NotNull DataObject dataObject, @NotNull ResultSet rs) throws SQLException {
 
		if (rs.getObject(users.creation_date.name()) != null) {
			dataObject.setCreationDate(new Date(rs.getTimestamp(users.creation_date.name()).getTime()));
		} 
 
		dataObject.setCreatorId(rs.getInt(users.creator_id.name()));
 
		if (rs.getObject(users.modification_date.name()) != null) {
			dataObject.setModificationDate(new Date(rs.getTimestamp(users.modification_date.name()).getTime()));
		} 
 
		return dataObject;
	} 
}