public CFBamISOCountryCurrencyBuff[] readBuffByCurrencyIdx( CFBamAuthorization Authorization, short ISOCurrencyId) { final String S_ProcName = "readBuffByCurrencyIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "SELECT * FROM " + schema.getLowerDbSchemaName() + ".sp_read_iso_cntryccy_by_currencyidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadBuffByCurrencyIdx == null) { stmtReadBuffByCurrencyIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByCurrencyIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCurrencyIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCurrencyIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCurrencyIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCurrencyIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByCurrencyIdx.setShort(argIdx++, ISOCurrencyId); resultSet = stmtReadBuffByCurrencyIdx.executeQuery(); List<CFBamISOCountryCurrencyBuff> buffList = new LinkedList<CFBamISOCountryCurrencyBuff>(); while (resultSet.next()) { CFBamISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFBamISOCountryCurrencyBuff[] retBuff = new CFBamISOCountryCurrencyBuff[buffList.size()]; Iterator<CFBamISOCountryCurrencyBuff> 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 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 CFBamISOCountryBuff[] readAllDerived(CFBamAuthorization Authorization) { final String S_ProcName = "readAllDerived"; String rqst = CFBamXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFBamXMsgISOCountryMessageFormatter.formatISOCountryRqstReadAll("\n\t\t\t") + "\n" + CFBamXMsgSchemaMessageFormatter.formatRqstXmlPostamble(); try { schema.getCFTipClientHandler().issueAppRequest(rqst); } catch (BadPaddingException e) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e); } catch (IllegalBlockSizeException e) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e); } catch (InvalidKeyException e) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e); } catch (NoSuchAlgorithmException e) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e); } catch (InvalidAlgorithmParameterException e) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Caught InvalidAlgorithmParameterException - " + e.getMessage(), e); } catch (NoSuchPaddingException e) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e); } ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler(); CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised(); if (exceptionRaised != null) { throw exceptionRaised; } Object sortedListObj = responseHandler.getListOfObjects(); if (sortedListObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getListOfObjects"); } @SuppressWarnings("unchecked") List<ICFBamISOCountryObj> sortedList = (List<ICFBamISOCountryObj>) sortedListObj; int sz = sortedList.size(); CFBamISOCountryBuff arr[] = new CFBamISOCountryBuff[sz]; Iterator<ICFBamISOCountryObj> iter = sortedList.iterator(); ICFBamISOCountryObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFBamISOCountryObj) iter.next(); arr[idx] = cur.getISOCountryBuff(); } return (arr); }