List of usage examples for java.sql CallableStatement setShort
void setShort(String parameterName, short x) throws SQLException;
short
value. From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOTimezoneTable.java
public CFFswISOTimezoneBuff lockBuff(CFFswAuthorization Authorization, CFFswISOTimezonePKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/* www.j av a 2s .c o m*/ ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtLockBuffByPKey = null; try { short ISOTimezoneId = PKey.getRequiredISOTimezoneId(); stmtLockBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".lck_isotz( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtLockBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, ISOTimezoneId); stmtLockBuffByPKey.execute(); resultSet = (ResultSet) stmtLockBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFFswISOTimezoneBuff buff = unpackISOTimezoneResultSetToBuff(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) { 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; } if (stmtLockBuffByPKey != null) { try { stmtLockBuffByPKey.close(); } catch (SQLException e) { } stmtLockBuffByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleISOCountryCurrencyTable.java
public CFSecurityISOCountryCurrencyBuff[] readBuffByCurrencyIdx(CFSecurityAuthorization Authorization, short ISOCurrencyId) { final String S_ProcName = "readBuffByCurrencyIdx"; ResultSet resultSet = null;// ww w .ja va 2 s .c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCurrencyIdx = null; List<CFSecurityISOCountryCurrencyBuff> buffList = new LinkedList<CFSecurityISOCountryCurrencyBuff>(); try { stmtReadBuffByCurrencyIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_cntryccybycurrencyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCurrencyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByCurrencyIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCurrencyIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFSecurityISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFSecurityISOCountryCurrencyBuff[] retBuff = new CFSecurityISOCountryCurrencyBuff[buffList.size()]; Iterator<CFSecurityISOCountryCurrencyBuff> 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; } if (stmtReadBuffByCurrencyIdx != null) { try { stmtReadBuffByCurrencyIdx.close(); } catch (SQLException e) { } stmtReadBuffByCurrencyIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleISOCountryLanguageTable.java
public CFSecurityISOCountryLanguageBuff[] readBuffByLanguageIdx(CFSecurityAuthorization Authorization, short ISOLanguageId) { final String S_ProcName = "readBuffByLanguageIdx"; ResultSet resultSet = null;/*ww w.j a v a2 s.c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByLanguageIdx = null; List<CFSecurityISOCountryLanguageBuff> buffList = new LinkedList<CFSecurityISOCountryLanguageBuff>(); try { stmtReadBuffByLanguageIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_cntrylngbylanguageidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByLanguageIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByLanguageIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByLanguageIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByLanguageIdx.setShort(argIdx++, ISOLanguageId); stmtReadBuffByLanguageIdx.execute(); resultSet = (ResultSet) stmtReadBuffByLanguageIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFSecurityISOCountryLanguageBuff buff = unpackISOCountryLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFSecurityISOCountryLanguageBuff[] retBuff = new CFSecurityISOCountryLanguageBuff[buffList.size()]; Iterator<CFSecurityISOCountryLanguageBuff> 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; } if (stmtReadBuffByLanguageIdx != null) { try { stmtReadBuffByLanguageIdx.close(); } catch (SQLException e) { } stmtReadBuffByLanguageIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleISOCountryCurrencyTable.java
public CFAccISOCountryCurrencyBuff[] readBuffByCurrencyIdx(CFAccAuthorization Authorization, short ISOCurrencyId) { final String S_ProcName = "readBuffByCurrencyIdx"; ResultSet resultSet = null;//from w w w .jav a 2 s .c om Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCurrencyIdx = null; List<CFAccISOCountryCurrencyBuff> buffList = new LinkedList<CFAccISOCountryCurrencyBuff>(); try { stmtReadBuffByCurrencyIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_cntryccybycurrencyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCurrencyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByCurrencyIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCurrencyIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAccISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAccISOCountryCurrencyBuff[] retBuff = new CFAccISOCountryCurrencyBuff[buffList.size()]; Iterator<CFAccISOCountryCurrencyBuff> 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; } if (stmtReadBuffByCurrencyIdx != null) { try { stmtReadBuffByCurrencyIdx.close(); } catch (SQLException e) { } stmtReadBuffByCurrencyIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleISOCountryLanguageTable.java
public CFAccISOCountryLanguageBuff[] readBuffByLanguageIdx(CFAccAuthorization Authorization, short ISOLanguageId) { final String S_ProcName = "readBuffByLanguageIdx"; ResultSet resultSet = null;//from www .j a v a 2 s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByLanguageIdx = null; List<CFAccISOCountryLanguageBuff> buffList = new LinkedList<CFAccISOCountryLanguageBuff>(); try { stmtReadBuffByLanguageIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_cntrylngbylanguageidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByLanguageIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByLanguageIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByLanguageIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByLanguageIdx.setShort(argIdx++, ISOLanguageId); stmtReadBuffByLanguageIdx.execute(); resultSet = (ResultSet) stmtReadBuffByLanguageIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAccISOCountryLanguageBuff buff = unpackISOCountryLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAccISOCountryLanguageBuff[] retBuff = new CFAccISOCountryLanguageBuff[buffList.size()]; Iterator<CFAccISOCountryLanguageBuff> 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; } if (stmtReadBuffByLanguageIdx != null) { try { stmtReadBuffByLanguageIdx.close(); } catch (SQLException e) { } stmtReadBuffByLanguageIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOCountryCurrencyTable.java
public CFAstISOCountryCurrencyBuff[] readBuffByCurrencyIdx(CFAstAuthorization Authorization, short ISOCurrencyId) { final String S_ProcName = "readBuffByCurrencyIdx"; ResultSet resultSet = null;/*ww w . jav a 2s . com*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCurrencyIdx = null; List<CFAstISOCountryCurrencyBuff> buffList = new LinkedList<CFAstISOCountryCurrencyBuff>(); try { stmtReadBuffByCurrencyIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_cntryccybycurrencyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCurrencyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByCurrencyIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCurrencyIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAstISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAstISOCountryCurrencyBuff[] retBuff = new CFAstISOCountryCurrencyBuff[buffList.size()]; Iterator<CFAstISOCountryCurrencyBuff> 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; } if (stmtReadBuffByCurrencyIdx != null) { try { stmtReadBuffByCurrencyIdx.close(); } catch (SQLException e) { } stmtReadBuffByCurrencyIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOCountryLanguageTable.java
public CFAstISOCountryLanguageBuff[] readBuffByLanguageIdx(CFAstAuthorization Authorization, short ISOLanguageId) { final String S_ProcName = "readBuffByLanguageIdx"; ResultSet resultSet = null;/* w w w .j a v a 2s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByLanguageIdx = null; List<CFAstISOCountryLanguageBuff> buffList = new LinkedList<CFAstISOCountryLanguageBuff>(); try { stmtReadBuffByLanguageIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_cntrylngbylanguageidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByLanguageIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByLanguageIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByLanguageIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByLanguageIdx.setShort(argIdx++, ISOLanguageId); stmtReadBuffByLanguageIdx.execute(); resultSet = (ResultSet) stmtReadBuffByLanguageIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAstISOCountryLanguageBuff buff = unpackISOCountryLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAstISOCountryLanguageBuff[] retBuff = new CFAstISOCountryLanguageBuff[buffList.size()]; Iterator<CFAstISOCountryLanguageBuff> 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; } if (stmtReadBuffByLanguageIdx != null) { try { stmtReadBuffByLanguageIdx.close(); } catch (SQLException e) { } stmtReadBuffByLanguageIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleISOCountryCurrencyTable.java
public CFAstISOCountryCurrencyBuff[] readBuffByCurrencyIdx(CFAstAuthorization Authorization, short ISOCurrencyId) { final String S_ProcName = "readBuffByCurrencyIdx"; ResultSet resultSet = null;//from ww w. java2s .c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCurrencyIdx = null; List<CFAstISOCountryCurrencyBuff> buffList = new LinkedList<CFAstISOCountryCurrencyBuff>(); try { stmtReadBuffByCurrencyIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_cntryccybycurrencyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCurrencyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByCurrencyIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCurrencyIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAstISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAstISOCountryCurrencyBuff[] retBuff = new CFAstISOCountryCurrencyBuff[buffList.size()]; Iterator<CFAstISOCountryCurrencyBuff> 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; } if (stmtReadBuffByCurrencyIdx != null) { try { stmtReadBuffByCurrencyIdx.close(); } catch (SQLException e) { } stmtReadBuffByCurrencyIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleISOCountryLanguageTable.java
public CFAstISOCountryLanguageBuff[] readBuffByLanguageIdx(CFAstAuthorization Authorization, short ISOLanguageId) { final String S_ProcName = "readBuffByLanguageIdx"; ResultSet resultSet = null;/*from w ww .j ava 2s .c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByLanguageIdx = null; List<CFAstISOCountryLanguageBuff> buffList = new LinkedList<CFAstISOCountryLanguageBuff>(); try { stmtReadBuffByLanguageIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_cntrylngbylanguageidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByLanguageIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByLanguageIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByLanguageIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByLanguageIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByLanguageIdx.setShort(argIdx++, ISOLanguageId); stmtReadBuffByLanguageIdx.execute(); resultSet = (ResultSet) stmtReadBuffByLanguageIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAstISOCountryLanguageBuff buff = unpackISOCountryLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAstISOCountryLanguageBuff[] retBuff = new CFAstISOCountryLanguageBuff[buffList.size()]; Iterator<CFAstISOCountryLanguageBuff> 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; } if (stmtReadBuffByLanguageIdx != null) { try { stmtReadBuffByLanguageIdx.close(); } catch (SQLException e) { } stmtReadBuffByLanguageIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOCountryCurrencyTable.java
public CFFswISOCountryCurrencyBuff[] readBuffByCurrencyIdx(CFFswAuthorization Authorization, short ISOCurrencyId) { final String S_ProcName = "readBuffByCurrencyIdx"; ResultSet resultSet = null;/* ww w .j a v a2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCurrencyIdx = null; List<CFFswISOCountryCurrencyBuff> buffList = new LinkedList<CFFswISOCountryCurrencyBuff>(); try { stmtReadBuffByCurrencyIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_cntryccybycurrencyidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCurrencyIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadBuffByCurrencyIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCurrencyIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFFswISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFFswISOCountryCurrencyBuff[] retBuff = new CFFswISOCountryCurrencyBuff[buffList.size()]; Iterator<CFFswISOCountryCurrencyBuff> 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; } if (stmtReadBuffByCurrencyIdx != null) { try { stmtReadBuffByCurrencyIdx.close(); } catch (SQLException e) { } stmtReadBuffByCurrencyIdx = null; } } }