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.cfasterisk.v2_1.CFAstOracle.CFAstOracleISOCurrencyTable.java
public void updateISOCurrency(CFAstAuthorization Authorization, CFAstISOCurrencyBuff Buff) { final String S_ProcName = "updateISOCurrency"; ResultSet resultSet = null;/*from w w w. j a va 2 s. c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFAstISOCurrencyBuff> buffList = new LinkedList<CFAstISOCurrencyBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); String UnitSymbol = Buff.getOptionalUnitSymbol(); String FracSymbol = Buff.getOptionalFracSymbol(); short Precis = Buff.getRequiredPrecis(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx.prepareCall( "begin " + schema.getLowerDbSchemaName() + ".upd_iso_ccy( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, Name); if (UnitSymbol != null) { stmtUpdateByPKey.setString(argIdx++, UnitSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } if (FracSymbol != null) { stmtUpdateByPKey.setString(argIdx++, FracSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } stmtUpdateByPKey.setShort(argIdx++, Precis); stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFAstISOCurrencyBuff 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.setOptionalFracSymbol(updatedBuff.getOptionalFracSymbol()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_ccy() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_ccy() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOCurrencyTable.java
public void updateISOCurrency(CFFswAuthorization Authorization, CFFswISOCurrencyBuff Buff) { final String S_ProcName = "updateISOCurrency"; ResultSet resultSet = null;/*from www. ja v a2 s.c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFFswISOCurrencyBuff> buffList = new LinkedList<CFFswISOCurrencyBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); String UnitSymbol = Buff.getOptionalUnitSymbol(); String FracSymbol = Buff.getOptionalFracSymbol(); short Precis = Buff.getRequiredPrecis(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx.prepareCall( "begin " + schema.getLowerDbSchemaName() + ".upd_iso_ccy( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, Name); if (UnitSymbol != null) { stmtUpdateByPKey.setString(argIdx++, UnitSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } if (FracSymbol != null) { stmtUpdateByPKey.setString(argIdx++, FracSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } stmtUpdateByPKey.setShort(argIdx++, Precis); stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFFswISOCurrencyBuff 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.setOptionalFracSymbol(updatedBuff.getOptionalFracSymbol()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_ccy() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_ccy() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleISOLanguageTable.java
public void updateISOLanguage(CFAccAuthorization Authorization, CFAccISOLanguageBuff Buff) { final String S_ProcName = "updateISOLanguage"; ResultSet resultSet = null;/*from w w w .ja va 2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFAccISOLanguageBuff> buffList = new LinkedList<CFAccISOLanguageBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String BaseLanguageCode = Buff.getRequiredBaseLanguageCode(); Short ISOCountryId = Buff.getOptionalISOCountryId(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx .prepareCall("begin " + schema.getLowerSchemaDbName() + ".upd_iso_lang( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISLN"); stmtUpdateByPKey.setShort(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, BaseLanguageCode); if (ISOCountryId != null) { stmtUpdateByPKey.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFAccISOLanguageBuff updatedBuff = unpackISOLanguageResultSetToBuff(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.setRequiredBaseLanguageCode(updatedBuff.getRequiredBaseLanguageCode()); Buff.setOptionalISOCountryId(updatedBuff.getOptionalISOCountryId()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOLanguageTable.java
public void updateISOLanguage(CFAstAuthorization Authorization, CFAstISOLanguageBuff Buff) { final String S_ProcName = "updateISOLanguage"; ResultSet resultSet = null;//from w w w .j a v a 2 s . co m Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFAstISOLanguageBuff> buffList = new LinkedList<CFAstISOLanguageBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String BaseLanguageCode = Buff.getRequiredBaseLanguageCode(); Short ISOCountryId = Buff.getOptionalISOCountryId(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx .prepareCall("begin " + schema.getLowerSchemaDbName() + ".upd_iso_lang( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISLN"); stmtUpdateByPKey.setShort(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, BaseLanguageCode); if (ISOCountryId != null) { stmtUpdateByPKey.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFAstISOLanguageBuff updatedBuff = unpackISOLanguageResultSetToBuff(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.setRequiredBaseLanguageCode(updatedBuff.getRequiredBaseLanguageCode()); Buff.setOptionalISOCountryId(updatedBuff.getOptionalISOCountryId()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleISOLanguageTable.java
public void updateISOLanguage(CFAstAuthorization Authorization, CFAstISOLanguageBuff Buff) { final String S_ProcName = "updateISOLanguage"; ResultSet resultSet = null;//from ww w .ja v a2 s . co m Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFAstISOLanguageBuff> buffList = new LinkedList<CFAstISOLanguageBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String BaseLanguageCode = Buff.getRequiredBaseLanguageCode(); Short ISOCountryId = Buff.getOptionalISOCountryId(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx .prepareCall("begin " + schema.getLowerDbSchemaName() + ".upd_iso_lang( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISLN"); stmtUpdateByPKey.setShort(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, BaseLanguageCode); if (ISOCountryId != null) { stmtUpdateByPKey.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFAstISOLanguageBuff updatedBuff = unpackISOLanguageResultSetToBuff(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.setRequiredBaseLanguageCode(updatedBuff.getRequiredBaseLanguageCode()); Buff.setOptionalISOCountryId(updatedBuff.getOptionalISOCountryId()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOLanguageTable.java
public void updateISOLanguage(CFFswAuthorization Authorization, CFFswISOLanguageBuff Buff) { final String S_ProcName = "updateISOLanguage"; ResultSet resultSet = null;//from w w w .ja va 2 s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFFswISOLanguageBuff> buffList = new LinkedList<CFFswISOLanguageBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String BaseLanguageCode = Buff.getRequiredBaseLanguageCode(); Short ISOCountryId = Buff.getOptionalISOCountryId(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx .prepareCall("begin " + schema.getLowerDbSchemaName() + ".upd_iso_lang( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISLN"); stmtUpdateByPKey.setShort(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, BaseLanguageCode); if (ISOCountryId != null) { stmtUpdateByPKey.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFFswISOLanguageBuff updatedBuff = unpackISOLanguageResultSetToBuff(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.setRequiredBaseLanguageCode(updatedBuff.getRequiredBaseLanguageCode()); Buff.setOptionalISOCountryId(updatedBuff.getOptionalISOCountryId()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCurrencyTable.java
public void updateISOCurrency(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOCurrencyBuff Buff) { final String S_ProcName = "updateISOCurrency"; ResultSet resultSet = null;/*w ww . j a v a2 s. c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFEnSyntaxISOCurrencyBuff> buffList = new LinkedList<CFEnSyntaxISOCurrencyBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String Name = Buff.getRequiredName(); String UnitSymbol = Buff.getOptionalUnitSymbol(); String FracSymbol = Buff.getOptionalFracSymbol(); short Precis = Buff.getRequiredPrecis(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx.prepareCall( "begin " + schema.getLowerDbSchemaName() + ".upd_iso_ccy( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, Name); if (UnitSymbol != null) { stmtUpdateByPKey.setString(argIdx++, UnitSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } if (FracSymbol != null) { stmtUpdateByPKey.setString(argIdx++, FracSymbol); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR); } stmtUpdateByPKey.setShort(argIdx++, Precis); stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFEnSyntaxISOCurrencyBuff 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.setOptionalFracSymbol(updatedBuff.getOptionalFracSymbol()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_ccy() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_ccy() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleAddressTable.java
public CFAccAddressBuff[] readBuffByCountryIdx(CFAccAuthorization Authorization, Short CountryId) { final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null;/* w ww. java2s. co m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFAccAddressBuff> buffList = new LinkedList<CFAccAddressBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_addressbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); 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()); if (CountryId != null) { stmtReadBuffByCountryIdx.setShort(argIdx++, CountryId.shortValue()); } else { stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAccAddressBuff buff = unpackAddressResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAccAddressBuff[] retBuff = new CFAccAddressBuff[buffList.size()]; Iterator<CFAccAddressBuff> 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.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleISOLanguageTable.java
public void updateISOLanguage(CFSecurityAuthorization Authorization, CFSecurityISOLanguageBuff Buff) { final String S_ProcName = "updateISOLanguage"; ResultSet resultSet = null;/*from www. jav a 2s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFSecurityISOLanguageBuff> buffList = new LinkedList<CFSecurityISOLanguageBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String BaseLanguageCode = Buff.getRequiredBaseLanguageCode(); Short ISOCountryId = Buff.getOptionalISOCountryId(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx .prepareCall("begin " + schema.getLowerDbSchemaName() + ".upd_iso_lang( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISLN"); stmtUpdateByPKey.setShort(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, BaseLanguageCode); if (ISOCountryId != null) { stmtUpdateByPKey.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFSecurityISOLanguageBuff updatedBuff = unpackISOLanguageResultSetToBuff(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.setRequiredBaseLanguageCode(updatedBuff.getRequiredBaseLanguageCode()); Buff.setOptionalISOCountryId(updatedBuff.getOptionalISOCountryId()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOLanguageTable.java
public void updateISOLanguage(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOLanguageBuff Buff) { final String S_ProcName = "updateISOLanguage"; ResultSet resultSet = null;/*w ww . j av a 2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFEnSyntaxISOLanguageBuff> buffList = new LinkedList<CFEnSyntaxISOLanguageBuff>(); try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String BaseLanguageCode = Buff.getRequiredBaseLanguageCode(); Short ISOCountryId = Buff.getOptionalISOCountryId(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx .prepareCall("begin " + schema.getLowerDbSchemaName() + ".upd_iso_lang( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); end;"); int argIdx = 1; stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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++, "ISLN"); stmtUpdateByPKey.setShort(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, ISOCode); stmtUpdateByPKey.setString(argIdx++, BaseLanguageCode); if (ISOCountryId != null) { stmtUpdateByPKey.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFEnSyntaxISOLanguageBuff updatedBuff = unpackISOLanguageResultSetToBuff(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.setRequiredBaseLanguageCode(updatedBuff.getRequiredBaseLanguageCode()); Buff.setOptionalISOCountryId(updatedBuff.getOptionalISOCountryId()); 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().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a valid result cursor"); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "upd_iso_lang() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }