List of usage examples for java.sql ResultSet getShort
short getShort(String columnLabel) throws SQLException;
ResultSet
object as a short
in the Java programming language. From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSFVMailTable.java
protected CFFswFSSFVMailBuff unpackFSSFVMailResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackFSSFVMailResultSetToBuff"; int idxcol = 1; CFFswFSSFVMailBuff buff = schema.getFactoryFSSFVMail().newBuff(); {/*from w w w . jav a 2s .c o m*/ String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFFswOracleSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFFswOracleSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredTenantId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredFSSFVMailId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredFSSofiaId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredName(resultSet.getString(idxcol)); idxcol++; buff.setRequiredTemplateFile(resultSet.getString(idxcol)); idxcol++; buff.setRequiredNotifyTemplateFile(resultSet.getString(idxcol)); idxcol++; buff.setRequiredDateFmt(resultSet.getString(idxcol)); idxcol++; buff.setRequiredEmailFrom(resultSet.getString(idxcol)); idxcol++; buff.setRequiredFileExtension(resultSet.getString(idxcol)); idxcol++; buff.setRequiredTerminatorKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredMaxLoginAttempts(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredDigitTimeout(resultSet.getInt(idxcol)); idxcol++; buff.setRequiredMinRecordLen(resultSet.getInt(idxcol)); idxcol++; buff.setRequiredMaxRecordLen(resultSet.getInt(idxcol)); idxcol++; buff.setRequiredMaxRetries(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredToneSpec(resultSet.getString(idxcol)); idxcol++; buff.setRequiredCallbackDialplan(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalCallbackContext(null); } else { buff.setOptionalCallbackContext(colVal); } } idxcol++; buff.setRequiredPlayNewMessagesKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredPlaySavedMessagesKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredLoginKeys(resultSet.getString(idxcol)); idxcol++; buff.setRequiredMainMenuKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredConfigMenuKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRecordGreetingKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredChooseGreetingKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredChangePassKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRecordNameKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRecordFileKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredListenFileKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredSaveFileKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredDeleteFileKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredUndeleteFileKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredEMailKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredPauseKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRestartKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredFastForwardKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRewindKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredSkipGreetKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRecordSilenceThreshold(resultSet.getInt(idxcol)); idxcol++; buff.setRequiredRecordSilenceHits(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredWebTemplateFile(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRecordSampleRate(resultSet.getInt(idxcol)); idxcol++; buff.setRequiredOperatorExtension(resultSet.getString(idxcol)); idxcol++; buff.setRequiredVMainExtension(resultSet.getString(idxcol)); idxcol++; buff.setRequiredVMailKey(resultSet.getString(idxcol)); idxcol++; buff.setRequiredAutoPlaybackRecordings(("Y".equals(resultSet.getString(idxcol)) ? true : false)); idxcol++; buff.setRequiredStorageDir(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalOdbcDSN(null); } else { buff.setOptionalOdbcDSN(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalRecordComent(null); } else { buff.setOptionalRecordComent(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalRecordTitle(null); } else { buff.setOptionalRecordTitle(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalRecordCopyright(null); } else { buff.setOptionalRecordCopyright(colVal); } } idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
From source file:com.funambol.foundation.items.dao.PIMContactDAO.java
/** * Creates a ContactWrapper object from a ResultSet. Only the basic data are * set.// ww w . j a v a 2 s.c om * * @param wrapperId the UID of the wrapper object to be returned * @param rs the result of the execution of a proper SQL SELECT statement on * the fnbl_pim_contact table, with the cursor before its first row * @return a newly created ContactWrapper initialized with the fields in the * result set * @throws java.sql.SQLException * @throws NotFoundException */ private static ContactWrapper createContact(String wrapperId, ResultSet rs) throws SQLException, NotFoundException { if (!rs.next()) { throw new NotFoundException("No contact found."); } ResultSetMetaData rsmd = rs.getMetaData(); ContactWrapper cw = null; Note note = null; Title title = null; String column = null; String userId = rs.getString(SQL_FIELD_USERID); Contact c = new Contact(); cw = new ContactWrapper(wrapperId, userId, c); int columnCount = rsmd.getColumnCount(); for (int i = 1; i <= columnCount; ++i) { column = rsmd.getColumnName(i); // // General // if (SQL_FIELD_ID.equalsIgnoreCase(column)) { // Does nothing: field already set at construction time } else if (SQL_FIELD_LAST_UPDATE.equalsIgnoreCase(column)) { cw.setLastUpdate(new Timestamp(rs.getLong(i))); } else if (SQL_FIELD_USERID.equalsIgnoreCase(column)) { // Does nothing: field already set at construction time } else if (SQL_FIELD_STATUS.equalsIgnoreCase(column)) { cw.setStatus(rs.getString(i).charAt(0)); } else if (SQL_FIELD_PHOTO_TYPE.equalsIgnoreCase(column)) { short phType = rs.getShort(i); if (!rs.wasNull()) { cw.setPhotoType(Short.valueOf(phType)); } // // contact details // } else if (SQL_FIELD_IMPORTANCE.equalsIgnoreCase(column)) { short importance = rs.getShort(i); if (!rs.wasNull()) { c.setImportance(Short.valueOf(importance)); } } else if (SQL_FIELD_SENSITIVITY.equalsIgnoreCase(column)) { short sensitivity = rs.getShort(i); if (!rs.wasNull()) { c.setSensitivity(Short.valueOf(sensitivity)); } } else if (SQL_FIELD_SUBJECT.equalsIgnoreCase(column)) { c.setSubject(rs.getString(i)); } else if (SQL_FIELD_FOLDER.equalsIgnoreCase(column)) { c.setFolder(rs.getString(i)); // // Personal details // } else if (SQL_FIELD_ANNIVERSARY.equalsIgnoreCase(column)) { c.getPersonalDetail().setAnniversary(rs.getString(i)); } else if (SQL_FIELD_FIRST_NAME.equalsIgnoreCase(column)) { c.getName().getFirstName().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_MIDDLE_NAME.equalsIgnoreCase(column)) { c.getName().getMiddleName().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_LAST_NAME.equalsIgnoreCase(column)) { c.getName().getLastName().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_DISPLAY_NAME.equalsIgnoreCase(column)) { c.getName().getDisplayName().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_BIRTHDAY.equalsIgnoreCase(column)) { c.getPersonalDetail().setBirthday(rs.getString(i)); } else if (SQL_FIELD_BODY.equalsIgnoreCase(column)) { String noteStr = rs.getString(i); if (noteStr != null) { note = new Note(); note.setNoteType(FIELD_NOTE); note.setPropertyValue(noteStr); c.addNote(note); } } else if (SQL_FIELD_CATEGORIES.equalsIgnoreCase(column)) { c.getCategories().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_CHILDREN.equalsIgnoreCase(column)) { c.getPersonalDetail().setChildren(rs.getString(i)); } else if (SQL_FIELD_HOBBIES.equalsIgnoreCase(column)) { c.getPersonalDetail().setHobbies(rs.getString(i)); } else if (SQL_FIELD_GENDER.equalsIgnoreCase(column)) { c.getPersonalDetail().setGender(rs.getString(i)); } else if (SQL_FIELD_INITIALS.equalsIgnoreCase(column)) { c.getName().getInitials().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_LANGUAGES.equalsIgnoreCase(column)) { c.setLanguages(rs.getString(i)); } else if (SQL_FIELD_NICKNAME.equalsIgnoreCase(column)) { c.getName().getNickname().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_SPOUSE.equalsIgnoreCase(column)) { c.getPersonalDetail().setSpouse(rs.getString(i)); } else if (SQL_FIELD_SUFFIX.equalsIgnoreCase(column)) { c.getName().getSuffix().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_TITLE.equalsIgnoreCase(column)) { c.getName().getSalutation().setPropertyValue(rs.getString(i)); // // Business details // } else if (SQL_FIELD_ASSISTANT.equalsIgnoreCase(column)) { c.getBusinessDetail().setAssistant(rs.getString(i)); } else if (SQL_FIELD_COMPANY.equalsIgnoreCase(column)) { c.getBusinessDetail().getCompany().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_COMPANIES.equalsIgnoreCase(column)) { c.getBusinessDetail().setCompanies(rs.getString(i)); } else if (SQL_FIELD_DEPARTMENT.equalsIgnoreCase(column)) { c.getBusinessDetail().getDepartment().setPropertyValue(rs.getString(i)); } else if (SQL_FIELD_JOB_TITLE.equalsIgnoreCase(column)) { String titleStr = null; titleStr = rs.getString(i); if (titleStr != null) { title = new Title(); title.setTitleType(FIELD_JOB_TITLE); title.setPropertyValue(titleStr); c.getBusinessDetail().addTitle(title); } } else if (SQL_FIELD_MANAGER.equalsIgnoreCase(column)) { c.getBusinessDetail().setManager(rs.getString(i)); } else if (SQL_FIELD_MILEAGE.equalsIgnoreCase(column)) { c.setMileage(rs.getString(i)); } else if (SQL_FIELD_OFFICE_LOCATION.equalsIgnoreCase(column)) { c.getBusinessDetail().setOfficeLocation(rs.getString(i)); } else if (SQL_FIELD_PROFESSION.equalsIgnoreCase(column)) { c.getBusinessDetail().getRole().setPropertyValue(rs.getString(i)); } else { throw new SQLException("Unhandled column: " + column); } } return cw; }
From source file:it.greenvulcano.gvesb.datahandling.dbo.utils.StandardRowSetBuilder.java
public int build(Document doc, String id, ResultSet rs, Set<Integer> keyField, Map<String, FieldFormatter> fieldNameToFormatter, Map<String, FieldFormatter> fieldIdToFormatter) throws Exception { if (rs == null) { return 0; }/*from w ww . ja v a 2s . co m*/ int rowCounter = 0; Element docRoot = doc.getDocumentElement(); ResultSetMetaData metadata = rs.getMetaData(); FieldFormatter[] fFormatters = buildFormatterArray(metadata, fieldNameToFormatter, fieldIdToFormatter); boolean noKey = ((keyField == null) || keyField.isEmpty()); //boolean isNull = false; Element data = null; Element row = null; Element col = null; Text text = null; String textVal = null; String precKey = null; String colKey = null; Map<String, String> keyAttr = new HashMap<String, String>(); while (rs.next()) { if (rowCounter % 10 == 0) { ThreadUtils.checkInterrupted(getClass().getSimpleName(), name, logger); } row = parser.createElement(doc, AbstractDBO.ROW_NAME); parser.setAttribute(row, AbstractDBO.ID_NAME, id); for (int j = 1; j <= metadata.getColumnCount(); j++) { FieldFormatter fF = fFormatters[j]; //isNull = false; col = parser.createElement(doc, AbstractDBO.COL_NAME); switch (metadata.getColumnType(j)) { case Types.DATE: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.DATE_TYPE); java.sql.Date dateVal = rs.getDate(j); textVal = processDateTime(col, fF, dateVal, AbstractDBO.DEFAULT_DATE_FORMAT); } break; case Types.TIME: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.TIME_TYPE); java.sql.Time dateVal = rs.getTime(j); textVal = processDateTime(col, fF, dateVal, AbstractDBO.DEFAULT_TIME_FORMAT); } break; case Types.TIMESTAMP: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.TIMESTAMP_TYPE); Timestamp dateVal = rs.getTimestamp(j); textVal = processDateTime(col, fF, dateVal, AbstractDBO.DEFAULT_DATE_FORMAT); } break; case Types.DOUBLE: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.FLOAT_TYPE); double numVal = rs.getDouble(j); textVal = processDouble(col, fF, numVal); } break; case Types.FLOAT: case Types.REAL: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.FLOAT_TYPE); float numVal = rs.getFloat(j); textVal = processDouble(col, fF, numVal); } break; case Types.BIGINT: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.BIGINT_TYPE); long numVal = rs.getLong(j); parser.setAttribute(col, AbstractDBO.NULL_NAME, "false"); textVal = String.valueOf(numVal); } break; case Types.INTEGER: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.INTEGER_TYPE); int numVal = rs.getInt(j); parser.setAttribute(col, AbstractDBO.NULL_NAME, "false"); textVal = String.valueOf(numVal); } break; case Types.SMALLINT: case Types.TINYINT: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.SMALLINT_TYPE); short numVal = rs.getShort(j); parser.setAttribute(col, AbstractDBO.NULL_NAME, "false"); textVal = String.valueOf(numVal); } break; case Types.NUMERIC: case Types.DECIMAL: { BigDecimal bigdecimal = rs.getBigDecimal(j); boolean isNull = bigdecimal == null; parser.setAttribute(col, AbstractDBO.NULL_NAME, String.valueOf(isNull)); if (isNull) { if (metadata.getScale(j) > 0) { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.DECIMAL_TYPE); } else { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.NUMERIC_TYPE); } textVal = ""; } else { if (fF != null) { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.DECIMAL_TYPE); parser.setAttribute(col, AbstractDBO.FORMAT_NAME, fF.getNumberFormat()); parser.setAttribute(col, AbstractDBO.GRP_SEPARATOR_NAME, fF.getGroupSeparator()); parser.setAttribute(col, AbstractDBO.DEC_SEPARATOR_NAME, fF.getDecSeparator()); textVal = fF.formatNumber(bigdecimal); } else if (metadata.getScale(j) > 0) { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.DECIMAL_TYPE); parser.setAttribute(col, AbstractDBO.FORMAT_NAME, numberFormat); parser.setAttribute(col, AbstractDBO.GRP_SEPARATOR_NAME, groupSeparator); parser.setAttribute(col, AbstractDBO.DEC_SEPARATOR_NAME, decSeparator); textVal = numberFormatter.format(bigdecimal); } else { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.NUMERIC_TYPE); textVal = bigdecimal.toString(); } } } break; case Types.BOOLEAN: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.BOOLEAN_TYPE); boolean bVal = rs.getBoolean(j); parser.setAttribute(col, AbstractDBO.NULL_NAME, "false"); textVal = String.valueOf(bVal); } break; case Types.SQLXML: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.XML_TYPE); SQLXML xml = rs.getSQLXML(j); boolean isNull = xml == null; parser.setAttribute(col, AbstractDBO.NULL_NAME, String.valueOf(isNull)); if (isNull) { textVal = ""; } else { textVal = xml.getString(); } } break; case Types.NCHAR: case Types.NVARCHAR: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.NSTRING_TYPE); textVal = rs.getNString(j); if (textVal == null) { textVal = ""; } } break; case Types.CHAR: case Types.VARCHAR: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.STRING_TYPE); textVal = rs.getString(j); boolean isNull = textVal == null; parser.setAttribute(col, AbstractDBO.NULL_NAME, String.valueOf(isNull)); if (isNull) { textVal = ""; } } break; case Types.NCLOB: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.LONG_NSTRING_TYPE); NClob clob = rs.getNClob(j); if (clob != null) { Reader is = clob.getCharacterStream(); StringWriter str = new StringWriter(); IOUtils.copy(is, str); is.close(); textVal = str.toString(); } else { textVal = ""; } } break; case Types.CLOB: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.LONG_STRING_TYPE); Clob clob = rs.getClob(j); if (clob != null) { Reader is = clob.getCharacterStream(); StringWriter str = new StringWriter(); IOUtils.copy(is, str); is.close(); textVal = str.toString(); } else { textVal = ""; } } break; case Types.BLOB: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.BASE64_TYPE); Blob blob = rs.getBlob(j); boolean isNull = blob == null; parser.setAttribute(col, AbstractDBO.NULL_NAME, String.valueOf(isNull)); if (isNull) { textVal = ""; } else { InputStream is = blob.getBinaryStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); IOUtils.copy(is, baos); is.close(); try { byte[] buffer = Arrays.copyOf(baos.toByteArray(), (int) blob.length()); textVal = Base64.getEncoder().encodeToString(buffer); } catch (SQLFeatureNotSupportedException exc) { textVal = Base64.getEncoder().encodeToString(baos.toByteArray()); } } } break; default: { parser.setAttribute(col, AbstractDBO.TYPE_NAME, AbstractDBO.DEFAULT_TYPE); textVal = rs.getString(j); boolean isNull = textVal == null; parser.setAttribute(col, AbstractDBO.NULL_NAME, String.valueOf(isNull)); if (isNull) { textVal = ""; } } } if (textVal != null) { text = doc.createTextNode(textVal); col.appendChild(text); } if (!noKey && keyField.contains(new Integer(j))) { if (textVal != null) { if (colKey == null) { colKey = textVal; } else { colKey += "##" + textVal; } keyAttr.put("key_" + j, textVal); } } else { row.appendChild(col); } } if (noKey) { if (data == null) { data = parser.createElement(doc, AbstractDBO.DATA_NAME); parser.setAttribute(data, AbstractDBO.ID_NAME, id); } } else if ((colKey != null) && !colKey.equals(precKey)) { if (data != null) { docRoot.appendChild(data); } data = parser.createElement(doc, AbstractDBO.DATA_NAME); parser.setAttribute(data, AbstractDBO.ID_NAME, id); for (Entry<String, String> keyAttrEntry : keyAttr.entrySet()) { parser.setAttribute(data, keyAttrEntry.getKey(), keyAttrEntry.getValue()); } keyAttr.clear(); precKey = colKey; } colKey = null; data.appendChild(row); rowCounter++; } if (data != null) { docRoot.appendChild(data); } return rowCounter; }
From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmDb2LUW.CFCrmDb2LUWAddressTable.java
protected CFCrmAddressBuff unpackAddressResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAddressResultSetToBuff"; int idxcol = 1; CFCrmAddressBuff buff = schema.getFactoryAddress().newBuff(); {// w w w .j a va2 s .com String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFCrmDb2LUWSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFCrmDb2LUWSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredTenantId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredAddressId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredContactId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine1(null); } else { buff.setOptionalAddrLine1(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine2(null); } else { buff.setOptionalAddrLine2(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalCity(null); } else { buff.setOptionalCity(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalState(null); } else { buff.setOptionalState(colVal); } } idxcol++; { short colVal = resultSet.getShort(idxcol); if (resultSet.wasNull()) { buff.setOptionalCountryId(null); } else { buff.setOptionalCountryId(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalZip(null); } else { buff.setOptionalZip(colVal); } } idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWAddressTable.java
protected CFAccAddressBuff unpackAddressResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAddressResultSetToBuff"; int idxcol = 1; CFAccAddressBuff buff = schema.getFactoryAddress().newBuff(); {/*from w ww .j a v a 2 s .co m*/ String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFAccDb2LUWSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFAccDb2LUWSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredTenantId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredAddressId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredContactId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine1(null); } else { buff.setOptionalAddrLine1(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine2(null); } else { buff.setOptionalAddrLine2(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalCity(null); } else { buff.setOptionalCity(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalState(null); } else { buff.setOptionalState(colVal); } } idxcol++; { short colVal = resultSet.getShort(idxcol); if (resultSet.wasNull()) { buff.setOptionalCountryId(null); } else { buff.setOptionalCountryId(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalZip(null); } else { buff.setOptionalZip(colVal); } } idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccPgSql.CFAccPgSqlAddressTable.java
protected CFAccAddressBuff unpackAddressResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAddressResultSetToBuff"; int idxcol = 1; CFAccAddressBuff buff = schema.getFactoryAddress().newBuff(); {/* ww w. j a va2s. co m*/ String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFAccPgSqlSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFAccPgSqlSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredTenantId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredAddressId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredContactId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine1(null); } else { buff.setOptionalAddrLine1(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine2(null); } else { buff.setOptionalAddrLine2(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalCity(null); } else { buff.setOptionalCity(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalState(null); } else { buff.setOptionalState(colVal); } } idxcol++; { short colVal = resultSet.getShort(idxcol); if (resultSet.wasNull()) { buff.setOptionalCountryId(null); } else { buff.setOptionalCountryId(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalZip(null); } else { buff.setOptionalZip(colVal); } } idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmMSSql.CFCrmMSSqlAddressTable.java
protected CFCrmAddressBuff unpackAddressResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAddressResultSetToBuff"; int idxcol = 1; CFCrmAddressBuff buff = schema.getFactoryAddress().newBuff(); {/*from w w w. j a v a 2 s . c o m*/ String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFCrmMSSqlSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFCrmMSSqlSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredTenantId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredAddressId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredContactId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine1(null); } else { buff.setOptionalAddrLine1(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine2(null); } else { buff.setOptionalAddrLine2(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalCity(null); } else { buff.setOptionalCity(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalState(null); } else { buff.setOptionalState(colVal); } } idxcol++; { short colVal = resultSet.getShort(idxcol); if (resultSet.wasNull()) { buff.setOptionalCountryId(null); } else { buff.setOptionalCountryId(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalZip(null); } else { buff.setOptionalZip(colVal); } } idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMSSql.CFAccMSSqlAddressTable.java
protected CFAccAddressBuff unpackAddressResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAddressResultSetToBuff"; int idxcol = 1; CFAccAddressBuff buff = schema.getFactoryAddress().newBuff(); {//from w w w . j a v a 2 s . c o m String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFAccMSSqlSchema.convertTimestampString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } idxcol++; colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFAccMSSqlSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredTenantId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredAddressId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredContactId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine1(null); } else { buff.setOptionalAddrLine1(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine2(null); } else { buff.setOptionalAddrLine2(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalCity(null); } else { buff.setOptionalCity(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalState(null); } else { buff.setOptionalState(colVal); } } idxcol++; { short colVal = resultSet.getShort(idxcol); if (resultSet.wasNull()) { buff.setOptionalCountryId(null); } else { buff.setOptionalCountryId(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalZip(null); } else { buff.setOptionalZip(colVal); } } idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmMySql.CFCrmMySqlAddressTable.java
protected CFCrmAddressBuff unpackAddressResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAddressResultSetToBuff"; int idxcol = 1; CFCrmAddressBuff buff = schema.getFactoryAddress().newBuff(); {/* w w w .j a va 2s. co m*/ String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFCrmMySqlSchema.convertTimestampString(colString)); } } idxcol++; { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } } idxcol++; { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFCrmMySqlSchema.convertTimestampString(colString)); } } idxcol++; { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } } idxcol++; buff.setRequiredTenantId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredAddressId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredContactId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine1(null); } else { buff.setOptionalAddrLine1(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine2(null); } else { buff.setOptionalAddrLine2(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalCity(null); } else { buff.setOptionalCity(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalState(null); } else { buff.setOptionalState(colVal); } } idxcol++; { short colVal = resultSet.getShort(idxcol); if (resultSet.wasNull()) { buff.setOptionalCountryId(null); } else { buff.setOptionalCountryId(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalZip(null); } else { buff.setOptionalZip(colVal); } } idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMySql.CFAccMySqlAddressTable.java
protected CFAccAddressBuff unpackAddressResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAddressResultSetToBuff"; int idxcol = 1; CFAccAddressBuff buff = schema.getFactoryAddress().newBuff(); {// www. ja v a 2s . c o m String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedAt(null); } else { buff.setCreatedAt(CFAccMySqlSchema.convertTimestampString(colString)); } } idxcol++; { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setCreatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setCreatedByUserId(null); } else { buff.setCreatedByUserId(UUID.fromString(colString)); } } idxcol++; { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedAt(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedAt(null); } else { buff.setUpdatedAt(CFAccMySqlSchema.convertTimestampString(colString)); } } idxcol++; { String colString = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setUpdatedByUserId(null); } else if ((colString == null) || (colString.length() <= 0)) { buff.setUpdatedByUserId(null); } else { buff.setUpdatedByUserId(UUID.fromString(colString)); } } idxcol++; buff.setRequiredTenantId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredAddressId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredContactId(resultSet.getLong(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine1(null); } else { buff.setOptionalAddrLine1(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalAddrLine2(null); } else { buff.setOptionalAddrLine2(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalCity(null); } else { buff.setOptionalCity(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalState(null); } else { buff.setOptionalState(colVal); } } idxcol++; { short colVal = resultSet.getShort(idxcol); if (resultSet.wasNull()) { buff.setOptionalCountryId(null); } else { buff.setOptionalCountryId(colVal); } } idxcol++; { String colVal = resultSet.getString(idxcol); if (resultSet.wasNull()) { buff.setOptionalZip(null); } else { buff.setOptionalZip(colVal); } } idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }