List of usage examples for java.sql Types SMALLINT
int SMALLINT
To view the source code for java.sql Types SMALLINT.
Click Source Link
The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type SMALLINT
.
From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternetOracle.CFInternetOracleISOLanguageTable.java
public CFInternetISOLanguageBuff[] readBuffByCountryIdx(CFInternetAuthorization Authorization, Short ISOCountryId) {//w ww . j a v a2s . co m final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFInternetISOLanguageBuff> buffList = new LinkedList<CFInternetISOLanguageBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_langbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); 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 (ISOCountryId != null) { stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFInternetISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFInternetISOLanguageBuff[] retBuff = new CFInternetISOLanguageBuff[buffList.size()]; Iterator<CFInternetISOLanguageBuff> 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.cfsecurity.v2_0.CFSecurityOracle.CFSecurityOracleISOLanguageTable.java
public CFSecurityISOLanguageBuff[] readBuffByCountryIdx(CFSecurityAuthorization Authorization, Short ISOCountryId) {// ww w . j a va 2 s. co m final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFSecurityISOLanguageBuff> buffList = new LinkedList<CFSecurityISOLanguageBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_langbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); 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 (ISOCountryId != null) { stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFSecurityISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFSecurityISOLanguageBuff[] retBuff = new CFSecurityISOLanguageBuff[buffList.size()]; Iterator<CFSecurityISOLanguageBuff> 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 CFSecurityISOLanguageBuff[] readBuffByCountryIdx(CFSecurityAuthorization Authorization, Short ISOCountryId) {/*w w w . jav a2s. c om*/ final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFSecurityISOLanguageBuff> buffList = new LinkedList<CFSecurityISOLanguageBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_langbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); 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 (ISOCountryId != null) { stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFSecurityISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFSecurityISOLanguageBuff[] retBuff = new CFSecurityISOLanguageBuff[buffList.size()]; Iterator<CFSecurityISOLanguageBuff> 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.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWContactURLTable.java
public CFAccContactURLBuff[] readBuffByProtocolIdx(CFAccAuthorization Authorization, Short URLProtocolId) { final String S_ProcName = "readBuffByProtocolIdx"; ResultSet resultSet = null;/*from w ww . j av a2s . c o m*/ try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_ctcurl_by_protocolidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadBuffByProtocolIdx == null) { stmtReadBuffByProtocolIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByProtocolIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByProtocolIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByProtocolIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByProtocolIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByProtocolIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (URLProtocolId != null) { stmtReadBuffByProtocolIdx.setShort(argIdx++, URLProtocolId.shortValue()); } else { stmtReadBuffByProtocolIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } resultSet = stmtReadBuffByProtocolIdx.executeQuery(); List<CFAccContactURLBuff> buffList = new LinkedList<CFAccContactURLBuff>(); while (resultSet.next()) { CFAccContactURLBuff buff = unpackContactURLResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFAccContactURLBuff[] retBuff = new CFAccContactURLBuff[buffList.size()]; Iterator<CFAccContactURLBuff> 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.CFAccPgSql.CFAccPgSqlContactURLTable.java
public CFAccContactURLBuff[] readBuffByProtocolIdx(CFAccAuthorization Authorization, Short URLProtocolId) { final String S_ProcName = "readBuffByProtocolIdx"; ResultSet resultSet = null;//from w ww. jav a 2s. c om try { Connection cnx = schema.getCnx(); String sql = "SELECT * FROM " + schema.getLowerSchemaDbName() + ".sp_read_ctcurl_by_protocolidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadBuffByProtocolIdx == null) { stmtReadBuffByProtocolIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByProtocolIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByProtocolIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByProtocolIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByProtocolIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByProtocolIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (URLProtocolId != null) { stmtReadBuffByProtocolIdx.setShort(argIdx++, URLProtocolId.shortValue()); } else { stmtReadBuffByProtocolIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } resultSet = stmtReadBuffByProtocolIdx.executeQuery(); List<CFAccContactURLBuff> buffList = new LinkedList<CFAccContactURLBuff>(); while (resultSet.next()) { CFAccContactURLBuff buff = unpackContactURLResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFAccContactURLBuff[] retBuff = new CFAccContactURLBuff[buffList.size()]; Iterator<CFAccContactURLBuff> 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.cfcrm.v2_1.CFCrmDb2LUW.CFCrmDb2LUWISOLanguageTable.java
public void updateISOLanguage(CFCrmAuthorization Authorization, CFCrmISOLanguageBuff Buff) { final String S_ProcName = "updateISOLanguage"; if ("ISLN".equals(Buff.getClassCode()) && (!schema.isSystemUser(Authorization))) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Permission denied -- only system user can modify ISOLanguage data"); }//from w w w . j a va2 s .co m ResultSet resultSet = null; try { short Id = Buff.getRequiredId(); String ISOCode = Buff.getRequiredISOCode(); String BaseLanguageCode = Buff.getRequiredBaseLanguageCode(); Short ISOCountryId = Buff.getOptionalISOCountryId(); int Revision = Buff.getRequiredRevision(); Connection cnx = schema.getCnx(); final String sql = "CALL sp_update_iso_lang( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " )"; 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++, "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); resultSet = stmtUpdateByPKey.executeQuery(); if (resultSet.next()) { CFCrmISOLanguageBuff 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().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOLanguageTable.java
public CFFswISOLanguageBuff[] readBuffByCountryIdx(CFFswAuthorization Authorization, Short ISOCountryId) { final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null;// w w w . j a va 2 s . c om Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFFswISOLanguageBuff> buffList = new LinkedList<CFFswISOLanguageBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_langbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); 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 (ISOCountryId != null) { stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFFswISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFFswISOLanguageBuff[] retBuff = new CFFswISOLanguageBuff[buffList.size()]; Iterator<CFFswISOLanguageBuff> 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_0.CFAstOracle.CFAstOracleISOLanguageTable.java
public CFAstISOLanguageBuff[] readBuffByCountryIdx(CFAstAuthorization Authorization, Short ISOCountryId) { final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null;/*from www .ja v a2s . c om*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFAstISOLanguageBuff> buffList = new LinkedList<CFAstISOLanguageBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_langbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); 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 (ISOCountryId != null) { stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAstISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAstISOLanguageBuff[] retBuff = new CFAstISOLanguageBuff[buffList.size()]; Iterator<CFAstISOLanguageBuff> 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_1.CFAstOracle.CFAstOracleISOLanguageTable.java
public CFAstISOLanguageBuff[] readBuffByCountryIdx(CFAstAuthorization Authorization, Short ISOCountryId) { final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null;// www. jav a 2s. co m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFAstISOLanguageBuff> buffList = new LinkedList<CFAstISOLanguageBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_langbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); 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 (ISOCountryId != null) { stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAstISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAstISOLanguageBuff[] retBuff = new CFAstISOLanguageBuff[buffList.size()]; Iterator<CFAstISOLanguageBuff> 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.cfacc.v2_0.CFAccOracle.CFAccOracleISOLanguageTable.java
public CFAccISOLanguageBuff[] readBuffByCountryIdx(CFAccAuthorization Authorization, Short ISOCountryId) { final String S_ProcName = "readBuffByCountryIdx"; ResultSet resultSet = null;/*from w ww . ja v a 2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCountryIdx = null; List<CFAccISOLanguageBuff> buffList = new LinkedList<CFAccISOLanguageBuff>(); try { stmtReadBuffByCountryIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_langbycountryidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); 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 (ISOCountryId != null) { stmtReadBuffByCountryIdx.setShort(argIdx++, ISOCountryId.shortValue()); } else { stmtReadBuffByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByCountryIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCountryIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAccISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAccISOLanguageBuff[] retBuff = new CFAccISOLanguageBuff[buffList.size()]; Iterator<CFAccISOLanguageBuff> 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; } } }