public void deleteISOCurrencyByCcyCdIdx( CFSecurityAuthorization Authorization, String argISOCode) { final String S_ProcName = "deleteISOCurrencyByCcyCdIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_delete_iso_ccy_by_ccycdidx ?, ?, ?, ?, ?" + ", " + "?"; if (stmtDeleteByCcyCdIdx == null) { stmtDeleteByCcyCdIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByCcyCdIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCcyCdIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByCcyCdIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByCcyCdIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCcyCdIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtDeleteByCcyCdIdx.setString(argIdx++, argISOCode); Object stuff = null; boolean moreResults = stmtDeleteByCcyCdIdx.execute(); while (stuff == null) { try { moreResults = stmtDeleteByCcyCdIdx.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { stuff = stmtDeleteByCcyCdIdx.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtDeleteByCcyCdIdx.getUpdateCount()) { break; } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
public CFSecurityISOCurrencyBuff readBuff( CFSecurityAuthorization Authorization, CFSecurityISOCurrencyPKey PKey) { final String S_ProcName = "readBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory() .newUsageException(getClass(), S_ProcName, "Transaction not open"); } ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); short ISOCurrencyId = PKey.getRequiredISOCurrencyId(); String sql = "{ call sp_read_iso_ccy( ?, ?, ?, ?, ?" + ", " + "?" + " ) }"; if (stmtReadBuffByPKey == null) { stmtReadBuffByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByPKey.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByPKey.setShort(argIdx++, ISOCurrencyId); resultSet = stmtReadBuffByPKey.executeQuery(); if ((resultSet != null) && resultSet.next()) { CFSecurityISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(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 CFSecurityISOCurrencyBuff[] readAllBuff(CFSecurityAuthorization 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(); String sql = "{ call sp_read_iso_ccy_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<CFSecurityISOCurrencyBuff> buffList = new LinkedList<CFSecurityISOCurrencyBuff>(); if (resultSet != null) { while (resultSet.next()) { CFSecurityISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); buffList.add(buff); } } int idx = 0; CFSecurityISOCurrencyBuff[] retBuff = new CFSecurityISOCurrencyBuff[buffList.size()]; Iterator<CFSecurityISOCurrencyBuff> 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 deleteISOCurrency( CFSecurityAuthorization Authorization, CFSecurityISOCurrencyBuff Buff) { final String S_ProcName = "deleteISOCurrency"; try { Connection cnx = schema.getCnx(); short ISOCurrencyId = Buff.getRequiredISOCurrencyId(); String sql = "exec sp_delete_iso_ccy ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?"; 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++, ISOCurrencyId); stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision()); ; Object stuff = null; boolean moreResults = stmtDeleteByPKey.execute(); while (stuff == null) { try { moreResults = stmtDeleteByPKey.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { stuff = stmtDeleteByPKey.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtDeleteByPKey.getUpdateCount()) { break; } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } }
public void updateISOCurrency( CFSecurityAuthorization Authorization, CFSecurityISOCurrencyBuff Buff) { final String S_ProcName = "updateISOCurrency"; ResultSet resultSet = null; try { short ISOCurrencyId = Buff.getRequiredISOCurrencyId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); String UnitSymbol = Buff.getOptionalUnitSymbol(); short Precis = Buff.getRequiredPrecis(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); String sql = "exec sp_update_iso_ccy ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"; 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++, "ISCY"); stmtUpdateByPKey.setShort(argIdx++, ISOCurrencyId); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, Name); if (UnitSymbol != null) { stmtUpdateByPKey.setString(argIdx++, UnitSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } stmtUpdateByPKey.setShort(argIdx++, Precis); stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); boolean moreResults = true; resultSet = null; while (resultSet == null) { try { moreResults = stmtUpdateByPKey.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { resultSet = stmtUpdateByPKey.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtUpdateByPKey.getUpdateCount()) { break; } } if (resultSet == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "resultSet"); } if (resultSet.next()) { CFSecurityISOCurrencyBuff updatedBuff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredISOCode(updatedBuff.getRequiredISOCode()); Buff.setRequiredName(updatedBuff.getRequiredName()); Buff.setOptionalUnitSymbol(updatedBuff.getOptionalUnitSymbol()); Buff.setRequiredPrecis(updatedBuff.getRequiredPrecis()); 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; } } }