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.CFFswOracleISOCountryLanguageTable.java
public CFFswISOCountryLanguageBuff[] readBuffByLanguageIdx(CFFswAuthorization Authorization, short ISOLanguageId) { final String S_ProcName = "readBuffByLanguageIdx"; ResultSet resultSet = null;/* www . j a v a 2 s.c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByLanguageIdx = null; List<CFFswISOCountryLanguageBuff> buffList = new LinkedList<CFFswISOCountryLanguageBuff>(); 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()) { CFFswISOCountryLanguageBuff buff = unpackISOCountryLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFFswISOCountryLanguageBuff[] retBuff = new CFFswISOCountryLanguageBuff[buffList.size()]; Iterator<CFFswISOCountryLanguageBuff> 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.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOTimezoneTable.java
public CFEnSyntaxISOTimezoneBuff readBuff(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOTimezonePKey PKey) { final String S_ProcName = "readBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from ww w . j ava 2 s. c om ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByPKey = null; try { short ISOTimezoneId = PKey.getRequiredISOTimezoneId(); stmtReadBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_isotz( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, ISOTimezoneId); stmtReadBuffByPKey.execute(); resultSet = (ResultSet) stmtReadBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxISOTimezoneBuff 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 (stmtReadBuffByPKey != null) { try { stmtReadBuffByPKey.close(); } catch (SQLException e) { } stmtReadBuffByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleISOCountryTable.java
public void createISOCountry(CFAccAuthorization Authorization, CFAccISOCountryBuff Buff) { final String S_ProcName = "createISOCountry"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w w w .java 2 s . c o m*/ ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".crt_iso_cntry( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISOC"); stmtCreateByPKey.setShort(argIdx++, Id); stmtCreateByPKey.setString(argIdx++, ISOCode); stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a result set"); } try { if (resultSet.next()) { CFAccISOCountryBuff createdBuff = unpackISOCountryResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setRequiredISOCode(createdBuff.getRequiredISOCode()); Buff.setRequiredName(createdBuff.getRequiredName()); 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().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOCountryTable.java
public void createISOCountry(CFAstAuthorization Authorization, CFAstISOCountryBuff Buff) { final String S_ProcName = "createISOCountry"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w .j a v a2s. c o m ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".crt_iso_cntry( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISOC"); stmtCreateByPKey.setShort(argIdx++, Id); stmtCreateByPKey.setString(argIdx++, ISOCode); stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a result set"); } try { if (resultSet.next()) { CFAstISOCountryBuff createdBuff = unpackISOCountryResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setRequiredISOCode(createdBuff.getRequiredISOCode()); Buff.setRequiredName(createdBuff.getRequiredName()); 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().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleISOCountryTable.java
public void createISOCountry(CFAstAuthorization Authorization, CFAstISOCountryBuff Buff) { final String S_ProcName = "createISOCountry"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*w ww. j a v a2 s . c o m*/ ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_iso_cntry( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISOC"); stmtCreateByPKey.setShort(argIdx++, Id); stmtCreateByPKey.setString(argIdx++, ISOCode); stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a result set"); } try { if (resultSet.next()) { CFAstISOCountryBuff createdBuff = unpackISOCountryResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setRequiredISOCode(createdBuff.getRequiredISOCode()); Buff.setRequiredName(createdBuff.getRequiredName()); 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().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOTimezoneTable.java
public CFEnSyntaxISOTimezoneBuff lockBuff(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOTimezonePKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from ww w . j av a 2 s . com*/ 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()) { CFEnSyntaxISOTimezoneBuff 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.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOCountryTable.java
public void createISOCountry(CFFswAuthorization Authorization, CFFswISOCountryBuff Buff) { final String S_ProcName = "createISOCountry"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*www .ja v a 2 s . c o m*/ ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_iso_cntry( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISOC"); stmtCreateByPKey.setShort(argIdx++, Id); stmtCreateByPKey.setString(argIdx++, ISOCode); stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a result set"); } try { if (resultSet.next()) { CFFswISOCountryBuff createdBuff = unpackISOCountryResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setRequiredISOCode(createdBuff.getRequiredISOCode()); Buff.setRequiredName(createdBuff.getRequiredName()); 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().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCountryTable.java
public void createISOCountry(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOCountryBuff Buff) { final String S_ProcName = "createISOCountry"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w w w . j a v a 2s .c o m*/ ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".crt_iso_cntry( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISOC"); stmtCreateByPKey.setShort(argIdx++, Id); stmtCreateByPKey.setString(argIdx++, ISOCode); stmtCreateByPKey.setString(argIdx++, Name); stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a result set"); } try { if (resultSet.next()) { CFEnSyntaxISOCountryBuff createdBuff = unpackISOCountryResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredId(createdBuff.getRequiredId()); Buff.setRequiredISOCode(createdBuff.getRequiredISOCode()); Buff.setRequiredName(createdBuff.getRequiredName()); 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().newRuntimeException(getClass(), S_ProcName, "crt_iso_cntry() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCountryCurrencyTable.java
public CFEnSyntaxISOCountryCurrencyBuff[] readBuffByCountryIdx(CFEnSyntaxAuthorization Authorization, short ISOCountryId) { final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null;//from w w w .j a v a 2s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFEnSyntaxISOCountryCurrencyBuff> buffList = new LinkedList<CFEnSyntaxISOCountryCurrencyBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_cntryccybycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCountryIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId); stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxISOCountryCurrencyBuff[] retBuff = new CFEnSyntaxISOCountryCurrencyBuff[buffList.size()]; Iterator<CFEnSyntaxISOCountryCurrencyBuff> 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 (stmtReadBuffByCountryIdx != null) { try { stmtReadBuffByCountryIdx.close(); } catch (SQLException e) { } stmtReadBuffByCountryIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCountryLanguageTable.java
public CFEnSyntaxISOCountryLanguageBuff[] readBuffByCountryIdx(CFEnSyntaxAuthorization Authorization, short ISOCountryId) { final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null;/*from w w w. j a v a 2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFEnSyntaxISOCountryLanguageBuff> buffList = new LinkedList<CFEnSyntaxISOCountryLanguageBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_cntrylngbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCountryIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId); stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxISOCountryLanguageBuff buff = unpackISOCountryLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxISOCountryLanguageBuff[] retBuff = new CFEnSyntaxISOCountryLanguageBuff[buffList.size()]; Iterator<CFEnSyntaxISOCountryLanguageBuff> 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 (stmtReadBuffByCountryIdx != null) { try { stmtReadBuffByCountryIdx.close(); } catch (SQLException e) { } stmtReadBuffByCountryIdx = null; } } }