Code example for ResultSet

Methods: getClob, getString, getTimestamp

0
		public PatientType buildPatientSet(ResultSet rowSet, String source,List<ParamType> metaDataParamList)
				throws SQLException, IOException { 
			PatientType patientDimensionType = new PatientType();
			PatientIdType patientIdType = new PatientIdType();
			patientIdType.setSource(source);
			patientIdType.setValue(rowSet.getString("patient_patient_num"));
			patientDimensionType.setPatientId(patientIdType);
 
			if (patientDetailFlag) {
 
				 
 
				 
 
				ParamTypeValueBuilder paramValBuilder = new ParamTypeValueBuilder();
				for (Iterator<ParamType> metaParamIterator = metaDataParamList.iterator(); metaParamIterator.hasNext();) { 
					ParamType metaParamType = metaParamIterator.next();
					if (metaParamType.getType().equalsIgnoreCase("string")) { 
						patientDimensionType.getParam().add(paramValBuilder.buildParamType(metaParamType,"patient_","_name",rowSet));	
					} else {  
						patientDimensionType.getParam().add(paramValBuilder.buildParamType(metaParamType,"patient_",null,rowSet));
					} 
					 
					 
				} 
			} 
 
			if (patientBlobFlag) {
				if (rowSet.getClob("patient_patient_blob") != null) {
					BlobType blobType = new BlobType();
					blobType.getContent().add(
							JDBCUtil.getClobStringWithLinebreak(rowSet
									.getClob("patient_patient_blob")));
				} 
			} 
 
			if (patientStatusFlag) {
				if (rowSet.getTimestamp("patient_update_date") != null) {
					patientDimensionType.setUpdateDate(dtoFactory
							.getXMLGregorianCalendar(rowSet.getTimestamp(
									"patient_update_date").getTime()));
				} 
 
				if (rowSet.getTimestamp("patient_download_date") != null) {
					patientDimensionType.setDownloadDate(dtoFactory
							.getXMLGregorianCalendar(rowSet.getTimestamp(
									"patient_download_date").getTime()));
				} 
 
				if (rowSet.getTimestamp("patient_import_date") != null) {
					patientDimensionType.setImportDate(dtoFactory
							.getXMLGregorianCalendar(rowSet.getTimestamp(
									"patient_import_date").getTime()));
				} 
 
				patientDimensionType.setSourcesystemCd(rowSet
						.getString("patient_sourcesystem_cd"));
				patientDimensionType.setUploadId(rowSet
						.getString("patient_upload_id"));
			} 
 
			return patientDimensionType;
		} 
	}