protected CFInternetURLProtocolBuff unpackURLProtocolResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackURLProtocolResultSetToBuff"; int idxcol = 1; CFInternetURLProtocolBuff buff = schema.getFactoryURLProtocol().newBuff(); { 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(CFBamDb2LUWSchema.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(CFBamDb2LUWSchema.convertTimestampString(colString)); } idxcol++; } buff.setRequiredURLProtocolId(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredName(resultSet.getString(idxcol)); idxcol++; buff.setRequiredDescription(resultSet.getString(idxcol)); idxcol++; buff.setRequiredIsSecure(("Y".equals(resultSet.getString(idxcol)) ? true : false)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
public CFBamAccessSecurityBuff lockBuff( CFBamAuthorization Authorization, CFBamAccessSecurityPKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); short Id = PKey.getRequiredId(); final String sql = "CALL sp_lock_accsec( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtLockBuffByPKey == null) { stmtLockBuffByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtLockBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtLockBuffByPKey.setShort(argIdx++, Id); resultSet = stmtLockBuffByPKey.executeQuery(); if (resultSet.next()) { CFBamAccessSecurityBuff buff = unpackAccessSecurityResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFBamAccessSecurityBuff[] readAllBuff(CFBamAuthorization Authorization) { final String S_ProcName = "readAllBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_accsec_all( ?, ?, ?, ?, ? )"; if (stmtReadAllBuff == null) { stmtReadAllBuff = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadAllBuff.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadAllBuff.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadAllBuff.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); resultSet = stmtReadAllBuff.executeQuery(); List<CFBamAccessSecurityBuff> buffList = new LinkedList<CFBamAccessSecurityBuff>(); while (resultSet.next()) { CFBamAccessSecurityBuff buff = unpackAccessSecurityResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFBamAccessSecurityBuff[] retBuff = new CFBamAccessSecurityBuff[buffList.size()]; Iterator<CFBamAccessSecurityBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public void deleteURLProtocolByIsSecureIdx( CFSecurityAuthorization Authorization, boolean argIsSecure) { final String S_ProcName = "deleteURLProtocolByIsSecureIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_delete_urlproto_by_issecureidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtDeleteByIsSecureIdx == null) { stmtDeleteByIsSecureIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByIsSecureIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByIsSecureIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argIsSecure) { stmtDeleteByIsSecureIdx.setString(argIdx++, "Y"); } else { stmtDeleteByIsSecureIdx.setString(argIdx++, "N"); } resultSet = stmtDeleteByIsSecureIdx.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public void deleteAccessFrequency( CFSecurityAuthorization Authorization, CFBamAccessFrequencyBuff Buff) { final String S_ProcName = "deleteAccessFrequency"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); short Id = Buff.getRequiredId(); final String sql = "CALL sp_delete_accfreq( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtDeleteByPKey == null) { stmtDeleteByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByPKey.setShort(argIdx++, Id); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; resultSet = stmtDeleteByPKey.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFBamAccessSecurityBuff[] readAllDerived(CFBamAuthorization Authorization) { final String S_ProcName = "readAllDerived"; CFBamAccessSecurityBuff[] buffArray; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buffArray = readAllBuff(Authorization); return (buffArray); }
public CFInternetURLProtocolBuff[] readDerivedByIsSecureIdx( CFSecurityAuthorization Authorization, boolean IsSecure) { final String S_ProcName = "readDerivedByIsSecureIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFInternetURLProtocolBuff[] buffList = readBuffByIsSecureIdx(Authorization, IsSecure); return (buffList); }
public CFBamAccessSecurityBuff readDerivedByIdIdx(CFBamAuthorization Authorization, short Id) { final String S_ProcName = "CFBamDb2LUWAccessSecurityTable.readDerivedByIdIdx() "; CFBamAccessSecurityBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buff = readBuffByIdIdx(Authorization, Id); return (buff); }
public CFInternetURLProtocolBuff readDerivedByUNameIdx( CFSecurityAuthorization Authorization, String Name) { final String S_ProcName = "CFBamDb2LUWURLProtocolTable.readDerivedByUNameIdx() "; CFInternetURLProtocolBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } buff = readBuffByUNameIdx(Authorization, Name); return (buff); }
public CFInternetURLProtocolBuff readDerived( CFSecurityAuthorization Authorization, CFInternetURLProtocolPKey PKey) { final String S_ProcName = "readDerived"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFInternetURLProtocolBuff buff; buff = readBuff(Authorization, PKey); return (buff); }
public String getSqlSelectURLProtocolDistinctClassCode() { if (S_sqlSelectURLProtocolDistinctClassCode == null) { S_sqlSelectURLProtocolDistinctClassCode = "SELECT " + "DISTINCT uprt.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + ".URLProto AS uprt "; } return (S_sqlSelectURLProtocolDistinctClassCode); }
public String getSqlSelectAccessFrequencyDistinctClassCode() { if (S_sqlSelectAccessFrequencyDistinctClassCode == null) { S_sqlSelectAccessFrequencyDistinctClassCode = "SELECT " + "DISTINCT afrq.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + ".accfreq AS afrq "; } return (S_sqlSelectAccessFrequencyDistinctClassCode); }
public CFBamAccessSecurityBuff lockDerived( CFBamAuthorization Authorization, CFBamAccessSecurityPKey PKey) { final String S_ProcName = "lockDerived"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } CFBamAccessSecurityBuff buff; buff = lockBuff(Authorization, PKey); return (buff); }
public String getSqlSelectAccessSecurityDistinctClassCode() { if (S_sqlSelectAccessSecurityDistinctClassCode == null) { S_sqlSelectAccessSecurityDistinctClassCode = "SELECT " + "DISTINCT asec.ClassCode " + "FROM " + schema.getLowerDbSchemaName() + ".accsec AS asec "; } return (S_sqlSelectAccessSecurityDistinctClassCode); }
protected CFBamAccessSecurityBuff unpackAccessSecurityResultSetToBuff(ResultSet resultSet) throws SQLException { final String S_ProcName = "unpackAccessSecurityResultSetToBuff"; int idxcol = 1; CFBamAccessSecurityBuff buff = schema.getFactoryAccessSecurity().newBuff(); buff.setRequiredId(resultSet.getShort(idxcol)); idxcol++; buff.setRequiredName(resultSet.getString(idxcol)); idxcol++; buff.setRequiredRevision(resultSet.getInt(idxcol)); return (buff); }
public String getSqlSelectAccessSecurityBuff() { if (S_sqlSelectAccessSecurityBuff == null) { S_sqlSelectAccessSecurityBuff = "SELECT " + "asec.Id, " + "asec.Name, " + "asec.Revision " + "FROM " + schema.getLowerDbSchemaName() + ".accsec AS asec "; } return (S_sqlSelectAccessSecurityBuff); }
public String getSqlSelectAccessFrequencyBuff() { if (S_sqlSelectAccessFrequencyBuff == null) { S_sqlSelectAccessFrequencyBuff = "SELECT " + "afrq.Id, " + "afrq.Name, " + "afrq.Revision " + "FROM " + schema.getLowerDbSchemaName() + ".accfreq AS afrq "; } return (S_sqlSelectAccessFrequencyBuff); }
public CFInternetURLProtocolBuff[] readBuffByIsSecureIdx( CFSecurityAuthorization Authorization, boolean IsSecure) { final String S_ProcName = "readBuffByIsSecureIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_urlproto_by_issecureidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadBuffByIsSecureIdx == null) { stmtReadBuffByIsSecureIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIsSecureIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIsSecureIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (IsSecure) { stmtReadBuffByIsSecureIdx.setString(argIdx++, "Y"); } else { stmtReadBuffByIsSecureIdx.setString(argIdx++, "N"); } resultSet = stmtReadBuffByIsSecureIdx.executeQuery(); List<CFInternetURLProtocolBuff> buffList = new LinkedList<CFInternetURLProtocolBuff>(); while (resultSet.next()) { CFInternetURLProtocolBuff buff = unpackURLProtocolResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFInternetURLProtocolBuff[] retBuff = new CFInternetURLProtocolBuff[buffList.size()]; Iterator<CFInternetURLProtocolBuff> iter = buffList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFInternetURLProtocolBuff readBuffByUNameIdx( CFSecurityAuthorization Authorization, String Name) { final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_urlproto_by_unameidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadBuffByUNameIdx == null) { stmtReadBuffByUNameIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByUNameIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUNameIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUNameIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUNameIdx.setString(argIdx++, Name); resultSet = stmtReadBuffByUNameIdx.executeQuery(); if (resultSet.next()) { CFInternetURLProtocolBuff buff = unpackURLProtocolResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public String getSqlSelectURLProtocolBuff() { if (S_sqlSelectURLProtocolBuff == null) { S_sqlSelectURLProtocolBuff = "SELECT " + "uprt.URLProtocolId, " + "uprt.Name, " + "uprt.Description, " + "uprt.IsSecure, " + "uprt.Revision " + "FROM " + schema.getLowerDbSchemaName() + ".URLProto AS uprt "; } return (S_sqlSelectURLProtocolBuff); }
public void updateAccessSecurity(CFBamAuthorization Authorization, CFBamAccessSecurityBuff Buff) { final String S_ProcName = "updateAccessSecurity"; if ("ASEC".equals(Buff.getClassCode()) && (!schema.isSystemUser(Authorization))) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Permission denied -- only system user can modify AccessSecurity data"); } ResultSet resultSet = null; try { short Id = Buff.getRequiredId(); String Name = Buff.getRequiredName(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_update_accsec( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtUpdateByPKey == null) { stmtUpdateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtUpdateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtUpdateByPKey.setString(argIdx++, "ASEC"); stmtUpdateByPKey.setShort(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, Name); stmtUpdateByPKey.setInt(argIdx++, Revision); resultSet = stmtUpdateByPKey.executeQuery(); if (resultSet.next()) { CFBamAccessSecurityBuff updatedBuff = unpackAccessSecurityResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredName(updatedBuff.getRequiredName()); Buff.setRequiredRevision(updatedBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public void createURLProtocol( CFSecurityAuthorization Authorization, CFInternetURLProtocolBuff Buff) { final String S_ProcName = "createURLProtocol"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { short URLProtocolId = Buff.getRequiredURLProtocolId(); String Name = Buff.getRequiredName(); String Description = Buff.getRequiredDescription(); boolean IsSecure = Buff.getRequiredIsSecure(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_create_urlproto( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtCreateByPKey == null) { stmtCreateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, "UPRT"); stmtCreateByPKey.setShort(argIdx++, URLProtocolId); stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.setString(argIdx++, Description); if (IsSecure) { stmtCreateByPKey.setString(argIdx++, "Y"); } else { stmtCreateByPKey.setString(argIdx++, "N"); } resultSet = stmtCreateByPKey.executeQuery(); if (resultSet.next()) { CFInternetURLProtocolBuff createdBuff = unpackURLProtocolResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredURLProtocolId(createdBuff.getRequiredURLProtocolId()); Buff.setRequiredName(createdBuff.getRequiredName()); Buff.setRequiredDescription(createdBuff.getRequiredDescription()); Buff.setRequiredIsSecure(createdBuff.getRequiredIsSecure()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); Buff.setCreatedByUserId(createdBuff.getCreatedByUserId()); Buff.setCreatedAt(createdBuff.getCreatedAt()); Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId()); Buff.setUpdatedAt(createdBuff.getUpdatedAt()); } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }