List of usage examples for java.sql Types BIGINT
int BIGINT
To view the source code for java.sql Types BIGINT.
Click Source Link
The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BIGINT
.
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMSSql.CFAccMSSqlAccountConfigTable.java
public CFAccAccountConfigBuff[] readBuffByVendCtcLstIdx(CFAccAuthorization Authorization, Long VendContactListTenantId, Long VendContactListId) { final String S_ProcName = "readBuffByVendCtcLstIdx"; ResultSet resultSet = null;//from w ww . ja va2 s . c om try { Connection cnx = schema.getCnx(); String sql = "{ call sp_read_acct_cfg_by_vendctclstidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ) }"; if (stmtReadBuffByVendCtcLstIdx == null) { stmtReadBuffByVendCtcLstIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByVendCtcLstIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByVendCtcLstIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (VendContactListTenantId != null) { stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, VendContactListTenantId.longValue()); } else { stmtReadBuffByVendCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListId != null) { stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, VendContactListId.longValue()); } else { stmtReadBuffByVendCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT); } resultSet = stmtReadBuffByVendCtcLstIdx.executeQuery(); List<CFAccAccountConfigBuff> buffList = new LinkedList<CFAccAccountConfigBuff>(); if (resultSet != null) { while (resultSet.next()) { CFAccAccountConfigBuff buff = unpackAccountConfigResultSetToBuff(resultSet); buffList.add(buff); } } int idx = 0; CFAccAccountConfigBuff[] retBuff = new CFAccAccountConfigBuff[buffList.size()]; Iterator<CFAccAccountConfigBuff> 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; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMySql.CFAccMySqlAccountConfigTable.java
public CFAccAccountConfigBuff[] readBuffByVendCtcLstIdx(CFAccAuthorization Authorization, Long VendContactListTenantId, Long VendContactListId) { final String S_ProcName = "readBuffByVendCtcLstIdx"; ResultSet resultSet = null;/*from w ww. ja v a 2 s.c o m*/ try { Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerSchemaDbName() + ".sp_read_acct_cfg_by_vendctclstidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadBuffByVendCtcLstIdx == null) { stmtReadBuffByVendCtcLstIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByVendCtcLstIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByVendCtcLstIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (VendContactListTenantId != null) { stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, VendContactListTenantId.longValue()); } else { stmtReadBuffByVendCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListId != null) { stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, VendContactListId.longValue()); } else { stmtReadBuffByVendCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT); } try { resultSet = stmtReadBuffByVendCtcLstIdx.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } List<CFAccAccountConfigBuff> buffList = new LinkedList<CFAccAccountConfigBuff>(); while ((resultSet != null) && resultSet.next()) { CFAccAccountConfigBuff buff = unpackAccountConfigResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFAccAccountConfigBuff[] retBuff = new CFAccAccountConfigBuff[buffList.size()]; Iterator<CFAccAccountConfigBuff> 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; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleAccountConfigTable.java
public CFAccAccountConfigBuff[] readBuffByEmpCtcLstIdx(CFAccAuthorization Authorization, Long EmpContactListTenantId, Long EmpContactListId) { final String S_ProcName = "readBuffByEmpCtcLstIdx"; ResultSet resultSet = null;// w w w . j av a 2s. co m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByEmpCtcLstIdx = null; List<CFAccAccountConfigBuff> buffList = new LinkedList<CFAccAccountConfigBuff>(); try { stmtReadBuffByEmpCtcLstIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_acct_cfgbyempctclstidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByEmpCtcLstIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByEmpCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByEmpCtcLstIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByEmpCtcLstIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByEmpCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByEmpCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (EmpContactListTenantId != null) { stmtReadBuffByEmpCtcLstIdx.setLong(argIdx++, EmpContactListTenantId.longValue()); } else { stmtReadBuffByEmpCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListId != null) { stmtReadBuffByEmpCtcLstIdx.setLong(argIdx++, EmpContactListId.longValue()); } else { stmtReadBuffByEmpCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByEmpCtcLstIdx.execute(); resultSet = (ResultSet) stmtReadBuffByEmpCtcLstIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAccAccountConfigBuff buff = unpackAccountConfigResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAccAccountConfigBuff[] retBuff = new CFAccAccountConfigBuff[buffList.size()]; Iterator<CFAccAccountConfigBuff> 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 (stmtReadBuffByEmpCtcLstIdx != null) { try { stmtReadBuffByEmpCtcLstIdx.close(); } catch (SQLException e) { } stmtReadBuffByEmpCtcLstIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleAccountTable.java
public void updateAccount(CFAccAuthorization Authorization, CFAccAccountBuff Buff) { final String S_ProcName = "updateAccount"; ResultSet resultSet = null;/*from w w w.j av a2 s . c om*/ Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFAccAccountBuff> buffList = new LinkedList<CFAccAccountBuff>(); try { long TenantId = Buff.getRequiredTenantId(); long Id = Buff.getRequiredId(); String AccountCode = Buff.getRequiredAccountCode(); String Description = Buff.getRequiredDescription(); short CurrencyId = Buff.getRequiredCurrencyId(); BigDecimal Balance = Buff.getRequiredBalance(); Long RollupTenantId = Buff.getOptionalRollupTenantId(); Long RollupAccountId = Buff.getOptionalRollupAccountId(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".upd_acct( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "ACCT"); stmtUpdateByPKey.setLong(argIdx++, TenantId); stmtUpdateByPKey.setLong(argIdx++, Id); stmtUpdateByPKey.setString(argIdx++, AccountCode); stmtUpdateByPKey.setString(argIdx++, Description); stmtUpdateByPKey.setShort(argIdx++, CurrencyId); stmtUpdateByPKey.setBigDecimal(argIdx++, Balance); if (RollupTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, RollupTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (RollupAccountId != null) { stmtUpdateByPKey.setLong(argIdx++, RollupAccountId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFAccAccountBuff updatedBuff = unpackAccountResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredAccountCode(updatedBuff.getRequiredAccountCode()); Buff.setRequiredDescription(updatedBuff.getRequiredDescription()); Buff.setRequiredCurrencyId(updatedBuff.getRequiredCurrencyId()); Buff.setRequiredBalance(updatedBuff.getRequiredBalance()); Buff.setOptionalRollupTenantId(updatedBuff.getOptionalRollupTenantId()); Buff.setOptionalRollupAccountId(updatedBuff.getOptionalRollupAccountId()); 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_acct() 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_acct() 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.CFAccPgSql.CFAccPgSqlAccountConfigTable.java
public void updateAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) { final String S_ProcName = "updateAccountConfig"; ResultSet resultSet = null;//from w w w . j av a2 s.c o m try { long TenantId = Buff.getRequiredTenantId(); short DefaultCurrencyId = Buff.getRequiredDefaultCurrencyId(); Long CustContactListTenantId = Buff.getOptionalCustContactListTenantId(); Long CustContactListId = Buff.getOptionalCustContactListId(); Long EmpContactListTenantId = Buff.getOptionalEmpContactListTenantId(); Long EmpContactListId = Buff.getOptionalEmpContactListId(); Long VendContactListTenantId = Buff.getOptionalVendContactListTenantId(); Long VendContactListId = Buff.getOptionalVendContactListId(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); String sql = "select * from " + schema.getLowerSchemaDbName() + ".sp_update_acct_cfg( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtUpdateByPKey == null) { stmtUpdateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtUpdateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtUpdateByPKey.setString(argIdx++, "ACFG"); stmtUpdateByPKey.setLong(argIdx++, TenantId); stmtUpdateByPKey.setShort(argIdx++, DefaultCurrencyId); if (CustContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, CustContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (CustContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, CustContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, EmpContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, EmpContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, VendContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, VendContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); resultSet = stmtUpdateByPKey.executeQuery(); if (resultSet.next()) { CFAccAccountConfigBuff updatedBuff = unpackAccountConfigResultSetToBuff(resultSet); if (resultSet.next()) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response"); } Buff.setRequiredDefaultCurrencyId(updatedBuff.getRequiredDefaultCurrencyId()); Buff.setOptionalCustContactListTenantId(updatedBuff.getOptionalCustContactListTenantId()); Buff.setOptionalCustContactListId(updatedBuff.getOptionalCustContactListId()); Buff.setOptionalEmpContactListTenantId(updatedBuff.getOptionalEmpContactListTenantId()); Buff.setOptionalEmpContactListId(updatedBuff.getOptionalEmpContactListId()); Buff.setOptionalVendContactListTenantId(updatedBuff.getOptionalVendContactListTenantId()); Buff.setOptionalVendContactListId(updatedBuff.getOptionalVendContactListId()); Buff.setRequiredRevision(updatedBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWAccountConfigTable.java
public void updateAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) { final String S_ProcName = "updateAccountConfig"; if ("ACFG".equals(Buff.getClassCode()) && (!schema.isTenantUser(Authorization, Buff.getRequiredTenantId(), "UpdateAccountConfig"))) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Permission denied -- User not part of TSecGroup UpdateAccountConfig"); }//from w w w . ja v a 2s . co m ResultSet resultSet = null; try { long TenantId = Buff.getRequiredTenantId(); short DefaultCurrencyId = Buff.getRequiredDefaultCurrencyId(); Long CustContactListTenantId = Buff.getOptionalCustContactListTenantId(); Long CustContactListId = Buff.getOptionalCustContactListId(); Long EmpContactListTenantId = Buff.getOptionalEmpContactListTenantId(); Long EmpContactListId = Buff.getOptionalEmpContactListId(); Long VendContactListTenantId = Buff.getOptionalVendContactListTenantId(); Long VendContactListId = Buff.getOptionalVendContactListId(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_update_acct_cfg( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtUpdateByPKey == null) { stmtUpdateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtUpdateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtUpdateByPKey.setString(argIdx++, "ACFG"); stmtUpdateByPKey.setLong(argIdx++, TenantId); stmtUpdateByPKey.setShort(argIdx++, DefaultCurrencyId); if (CustContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, CustContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (CustContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, CustContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, EmpContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, EmpContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, VendContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, VendContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); resultSet = stmtUpdateByPKey.executeQuery(); if (resultSet.next()) { CFAccAccountConfigBuff updatedBuff = unpackAccountConfigResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredDefaultCurrencyId(updatedBuff.getRequiredDefaultCurrencyId()); Buff.setOptionalCustContactListTenantId(updatedBuff.getOptionalCustContactListTenantId()); Buff.setOptionalCustContactListId(updatedBuff.getOptionalCustContactListId()); Buff.setOptionalEmpContactListTenantId(updatedBuff.getOptionalEmpContactListTenantId()); Buff.setOptionalEmpContactListId(updatedBuff.getOptionalEmpContactListId()); Buff.setOptionalVendContactListTenantId(updatedBuff.getOptionalVendContactListTenantId()); Buff.setOptionalVendContactListId(updatedBuff.getOptionalVendContactListId()); Buff.setRequiredRevision(updatedBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMSSql.CFAccMSSqlAccountConfigTable.java
public void updateAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) { final String S_ProcName = "updateAccountConfig"; ResultSet resultSet = null;/* ww w . j a v a 2 s . co m*/ try { long TenantId = Buff.getRequiredTenantId(); short DefaultCurrencyId = Buff.getRequiredDefaultCurrencyId(); Long CustContactListTenantId = Buff.getOptionalCustContactListTenantId(); Long CustContactListId = Buff.getOptionalCustContactListId(); Long EmpContactListTenantId = Buff.getOptionalEmpContactListTenantId(); Long EmpContactListId = Buff.getOptionalEmpContactListId(); Long VendContactListTenantId = Buff.getOptionalVendContactListTenantId(); Long VendContactListId = Buff.getOptionalVendContactListId(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); String sql = "exec sp_update_acct_cfg ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"; if (stmtUpdateByPKey == null) { stmtUpdateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtUpdateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtUpdateByPKey.setString(argIdx++, "ACFG"); stmtUpdateByPKey.setLong(argIdx++, TenantId); stmtUpdateByPKey.setShort(argIdx++, DefaultCurrencyId); if (CustContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, CustContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (CustContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, CustContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, EmpContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, EmpContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, VendContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, VendContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); boolean moreResults = true; resultSet = null; while (resultSet == null) { try { moreResults = stmtUpdateByPKey.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { resultSet = stmtUpdateByPKey.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtUpdateByPKey.getUpdateCount()) { break; } } if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "resultSet"); } if (resultSet.next()) { CFAccAccountConfigBuff updatedBuff = unpackAccountConfigResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredDefaultCurrencyId(updatedBuff.getRequiredDefaultCurrencyId()); Buff.setOptionalCustContactListTenantId(updatedBuff.getOptionalCustContactListTenantId()); Buff.setOptionalCustContactListId(updatedBuff.getOptionalCustContactListId()); Buff.setOptionalEmpContactListTenantId(updatedBuff.getOptionalEmpContactListTenantId()); Buff.setOptionalEmpContactListId(updatedBuff.getOptionalEmpContactListId()); Buff.setOptionalVendContactListTenantId(updatedBuff.getOptionalVendContactListTenantId()); Buff.setOptionalVendContactListId(updatedBuff.getOptionalVendContactListId()); Buff.setRequiredRevision(updatedBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnglishParseTable.java
public CFEnSyntaxEnglishParseBuff readDerivedByUNameIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId, String Name) {/*ww w. j a v a 2 s . c om*/ final String S_ProcName = "CFEnSyntaxMySqlEnglishParseTable.readDerivedByUNameIdx() "; CFEnSyntaxEnglishParseBuff buff; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); } String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerDbSchemaName() + ".sp_read_enparse_cc_by_unameidx( ?, ?, ?, ?, ?, ?, ? )"; if (stmtReadClassCodeByUNameIdx == null) { stmtReadClassCodeByUNameIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadClassCodeByUNameIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadClassCodeByUNameIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadClassCodeByUNameIdx.setString(argIdx++, Name); try { resultSet = stmtReadClassCodeByUNameIdx.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { classCode = resultSet.getString(1); if ((resultSet != null) && resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } if (classCode.equals("ENPS")) { buff = readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENDS")) { buff = schema.getTableEnDiscourse().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENSN")) { buff = schema.getTableEnSentence().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENCL")) { buff = schema.getTableEnClause().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENPH")) { buff = schema.getTableEnPhrase().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENWD")) { buff = schema.getTableEnWord().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENPR")) { buff = schema.getTableEnPreposition().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENMP")) { buff = schema.getTableEnMorpheme().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENSJ")) { buff = schema.getTableEnSubject().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENOB")) { buff = schema.getTableEnObject().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENCM")) { buff = schema.getTableEnComplement().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENVL")) { buff = schema.getTableEnAdverbial().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENAD")) { buff = schema.getTableEnAdjective().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENTS")) { buff = schema.getTableEnTense().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENAX")) { buff = schema.getTableEnAuxiliary().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENCN")) { buff = schema.getTableEnConnective().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENDT")) { buff = schema.getTableEnDeterminer().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENHD")) { buff = schema.getTableEnHead().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("ENIN")) { buff = schema.getTableEnIntensifier().readBuffByUNameIdx(Authorization, ScopeId, Name); } else if (classCode.equals("EMOD")) { buff = schema.getTableEnModifier().readBuffByUNameIdx(Authorization, ScopeId, Name); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } return (buff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMySql.CFAccMySqlAccountConfigTable.java
public void updateAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) { final String S_ProcName = "updateAccountConfig"; ResultSet resultSet = null;/* ww w . ja v a2s. c om*/ try { long TenantId = Buff.getRequiredTenantId(); short DefaultCurrencyId = Buff.getRequiredDefaultCurrencyId(); Long CustContactListTenantId = Buff.getOptionalCustContactListTenantId(); Long CustContactListId = Buff.getOptionalCustContactListId(); Long EmpContactListTenantId = Buff.getOptionalEmpContactListTenantId(); Long EmpContactListId = Buff.getOptionalEmpContactListId(); Long VendContactListTenantId = Buff.getOptionalVendContactListTenantId(); Long VendContactListId = Buff.getOptionalVendContactListId(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerSchemaDbName() + ".sp_update_acct_cfg( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; if (stmtUpdateByPKey == null) { stmtUpdateByPKey = cnx.prepareStatement(sql); } int argIdx = 1; stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtUpdateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtUpdateByPKey.setString(argIdx++, "ACFG"); stmtUpdateByPKey.setLong(argIdx++, TenantId); stmtUpdateByPKey.setShort(argIdx++, DefaultCurrencyId); if (CustContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, CustContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (CustContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, CustContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, EmpContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (EmpContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, EmpContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListTenantId != null) { stmtUpdateByPKey.setLong(argIdx++, VendContactListTenantId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListId != null) { stmtUpdateByPKey.setLong(argIdx++, VendContactListId.longValue()); } else { stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT); } stmtUpdateByPKey.setInt(argIdx++, Revision); try { resultSet = stmtUpdateByPKey.executeQuery(); } catch (SQLException e) { if (e.getErrorCode() != 1329) { throw e; } resultSet = null; } if ((resultSet != null) && resultSet.next()) { CFAccAccountConfigBuff updatedBuff = unpackAccountConfigResultSetToBuff(resultSet); if ((resultSet != null) && resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredDefaultCurrencyId(updatedBuff.getRequiredDefaultCurrencyId()); Buff.setOptionalCustContactListTenantId(updatedBuff.getOptionalCustContactListTenantId()); Buff.setOptionalCustContactListId(updatedBuff.getOptionalCustContactListId()); Buff.setOptionalEmpContactListTenantId(updatedBuff.getOptionalEmpContactListTenantId()); Buff.setOptionalEmpContactListId(updatedBuff.getOptionalEmpContactListId()); Buff.setOptionalVendContactListTenantId(updatedBuff.getOptionalVendContactListTenantId()); Buff.setOptionalVendContactListId(updatedBuff.getOptionalVendContactListId()); Buff.setRequiredRevision(updatedBuff.getRequiredRevision()); } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected a single-record response, " + resultSet.getRow() + " rows selected"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleAccountConfigTable.java
public CFAccAccountConfigBuff[] readBuffByVendCtcLstIdx(CFAccAuthorization Authorization, Long VendContactListTenantId, Long VendContactListId) { final String S_ProcName = "readBuffByVendCtcLstIdx"; ResultSet resultSet = null;//from w w w .ja v a 2 s .c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByVendCtcLstIdx = null; List<CFAccAccountConfigBuff> buffList = new LinkedList<CFAccAccountConfigBuff>(); try { stmtReadBuffByVendCtcLstIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_acct_cfgbyvendctclstidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByVendCtcLstIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByVendCtcLstIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByVendCtcLstIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (VendContactListTenantId != null) { stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, VendContactListTenantId.longValue()); } else { stmtReadBuffByVendCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT); } if (VendContactListId != null) { stmtReadBuffByVendCtcLstIdx.setLong(argIdx++, VendContactListId.longValue()); } else { stmtReadBuffByVendCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByVendCtcLstIdx.execute(); resultSet = (ResultSet) stmtReadBuffByVendCtcLstIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAccAccountConfigBuff buff = unpackAccountConfigResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAccAccountConfigBuff[] retBuff = new CFAccAccountConfigBuff[buffList.size()]; Iterator<CFAccAccountConfigBuff> 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 (stmtReadBuffByVendCtcLstIdx != null) { try { stmtReadBuffByVendCtcLstIdx.close(); } catch (SQLException e) { } stmtReadBuffByVendCtcLstIdx = null; } } }