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.cfacc.v2_0.CFAccPgSql.CFAccPgSqlAddressTable.java
public void deleteAddressByCountryIdx(CFAccAuthorization Authorization, Short argCountryId) { final String S_ProcName = "deleteAddressByCountryIdx"; ResultSet resultSet = null;//from w w w .j a v a 2s. c om try { Connection cnx = schema.getCnx(); String sql = "SELECT " + schema.getLowerSchemaDbName() + ".sp_delete_address_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag"; if (stmtDeleteByCountryIdx == null) { stmtDeleteByCountryIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argCountryId != null) { stmtDeleteByCountryIdx.setShort(argIdx++, argCountryId.shortValue()); } else { stmtDeleteByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } resultSet = stmtDeleteByCountryIdx.executeQuery(); if (resultSet.next()) { boolean deleteFlag = resultSet.getBoolean(1); if (resultSet.next()) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response"); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } 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.CFCrmMSSql.CFCrmMSSqlAddressTable.java
public void deleteAddressByCountryIdx(CFCrmAuthorization Authorization, Short argCountryId) { final String S_ProcName = "deleteAddressByCountryIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w . jav a 2s . co m ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_delete_address_by_countryidx ?, ?, ?, ?, ?" + ", " + "?"; if (stmtDeleteByCountryIdx == null) { stmtDeleteByCountryIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argCountryId != null) { stmtDeleteByCountryIdx.setShort(argIdx++, argCountryId.shortValue()); } else { stmtDeleteByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } Object stuff = null; boolean moreResults = stmtDeleteByCountryIdx.execute(); while (stuff == null) { try { moreResults = stmtDeleteByCountryIdx.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { stuff = stmtDeleteByCountryIdx.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtDeleteByCountryIdx.getUpdateCount()) { break; } } } 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.CFAccDb2LUWAddressTable.java
public void deleteAddressByCountryIdx(CFAccAuthorization Authorization, Short argCountryId) { final String S_ProcName = "deleteAddressByCountryIdx"; ResultSet resultSet = null;//from w ww .j a v a 2s . c o m try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_delete_address_by_countryidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtDeleteByCountryIdx == null) { stmtDeleteByCountryIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argCountryId != null) { stmtDeleteByCountryIdx.setShort(argIdx++, argCountryId.shortValue()); } else { stmtDeleteByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } resultSet = stmtDeleteByCountryIdx.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } 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.CFAccMySqlContactTable.java
public void deleteContactByTimezoneIdx(CFAccAuthorization Authorization, Short argISOTimezoneId) { final String S_ProcName = "deleteContactByTimezoneIdx"; ResultSet resultSet = null;/*from w w w . jav a 2 s . com*/ try { Connection cnx = schema.getCnx(); String sql = "call " + schema.getLowerSchemaDbName() + ".sp_delete_contact_by_timezoneidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtDeleteByTimezoneIdx == null) { stmtDeleteByTimezoneIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argISOTimezoneId != null) { stmtDeleteByTimezoneIdx.setShort(argIdx++, argISOTimezoneId.shortValue()); } else { stmtDeleteByTimezoneIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtDeleteByTimezoneIdx.executeUpdate(); } 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.CFAccPgSqlContactTable.java
public void deleteContactByTimezoneIdx(CFAccAuthorization Authorization, Short argISOTimezoneId) { final String S_ProcName = "deleteContactByTimezoneIdx"; ResultSet resultSet = null;// www . ja v a2s.c o m try { Connection cnx = schema.getCnx(); String sql = "SELECT " + schema.getLowerSchemaDbName() + ".sp_delete_contact_by_timezoneidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) as DeletedFlag"; if (stmtDeleteByTimezoneIdx == null) { stmtDeleteByTimezoneIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argISOTimezoneId != null) { stmtDeleteByTimezoneIdx.setShort(argIdx++, argISOTimezoneId.shortValue()); } else { stmtDeleteByTimezoneIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } resultSet = stmtDeleteByTimezoneIdx.executeQuery(); if (resultSet.next()) { boolean deleteFlag = resultSet.getBoolean(1); if (resultSet.next()) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response"); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } 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.CFAccMSSqlAccountEntryTable.java
public CFAccAccountEntryBuff[] readBuffByDrCcyIdx(CFAccAuthorization Authorization, Short DebitCurrencyId) { final String S_ProcName = "readBuffByDrCcyIdx"; ResultSet resultSet = null;/*from w ww . ja v a2 s .com*/ try { Connection cnx = schema.getCnx(); String sql = "{ call sp_read_ac_entry_by_drccyidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }"; if (stmtReadBuffByDrCcyIdx == null) { stmtReadBuffByDrCcyIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByDrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByDrCcyIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByDrCcyIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByDrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByDrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (DebitCurrencyId != null) { stmtReadBuffByDrCcyIdx.setShort(argIdx++, DebitCurrencyId.shortValue()); } else { stmtReadBuffByDrCcyIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } resultSet = stmtReadBuffByDrCcyIdx.executeQuery(); List<CFAccAccountEntryBuff> buffList = new LinkedList<CFAccAccountEntryBuff>(); if (resultSet != null) { while (resultSet.next()) { CFAccAccountEntryBuff buff = unpackAccountEntryResultSetToBuff(resultSet); buffList.add(buff); } } int idx = 0; CFAccAccountEntryBuff[] retBuff = new CFAccAccountEntryBuff[buffList.size()]; Iterator<CFAccAccountEntryBuff> 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.CFCrmMSSql.CFCrmMSSqlContactTable.java
public void deleteContactByTimezoneIdx(CFCrmAuthorization Authorization, Short argISOTimezoneId) { final String S_ProcName = "deleteContactByTimezoneIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w . ja v a 2s. c o m ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_delete_contact_by_timezoneidx ?, ?, ?, ?, ?" + ", " + "?"; if (stmtDeleteByTimezoneIdx == null) { stmtDeleteByTimezoneIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argISOTimezoneId != null) { stmtDeleteByTimezoneIdx.setShort(argIdx++, argISOTimezoneId.shortValue()); } else { stmtDeleteByTimezoneIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } Object stuff = null; boolean moreResults = stmtDeleteByTimezoneIdx.execute(); while (stuff == null) { try { moreResults = stmtDeleteByTimezoneIdx.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { stuff = stmtDeleteByTimezoneIdx.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtDeleteByTimezoneIdx.getUpdateCount()) { break; } } } 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.CFAccDb2LUWContactTable.java
public void deleteContactByTimezoneIdx(CFAccAuthorization Authorization, Short argISOTimezoneId) { final String S_ProcName = "deleteContactByTimezoneIdx"; ResultSet resultSet = null;/*from w ww.ja v a 2 s . c o m*/ try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_delete_contact_by_timezoneidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtDeleteByTimezoneIdx == null) { stmtDeleteByTimezoneIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argISOTimezoneId != null) { stmtDeleteByTimezoneIdx.setShort(argIdx++, argISOTimezoneId.shortValue()); } else { stmtDeleteByTimezoneIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } resultSet = stmtDeleteByTimezoneIdx.executeQuery(); if (resultSet.next()) { int deleteFlag = resultSet.getInt(1); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Expected 1 record result set to be returned by delete, not 0 rows"); } } 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.CFAccDb2LUWAccountEntryTable.java
public CFAccAccountEntryBuff[] readBuffByCrCcyIdx(CFAccAuthorization Authorization, Short CreditCurrencyId) { final String S_ProcName = "readBuffByCrCcyIdx"; ResultSet resultSet = null;// ww w . j a v a 2 s. c o m try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_ac_entry_by_crccyidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadBuffByCrCcyIdx == null) { stmtReadBuffByCrCcyIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByCrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCrCcyIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCrCcyIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCrCcyIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (CreditCurrencyId != null) { stmtReadBuffByCrCcyIdx.setShort(argIdx++, CreditCurrencyId.shortValue()); } else { stmtReadBuffByCrCcyIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } resultSet = stmtReadBuffByCrCcyIdx.executeQuery(); List<CFAccAccountEntryBuff> buffList = new LinkedList<CFAccAccountEntryBuff>(); while (resultSet.next()) { CFAccAccountEntryBuff buff = unpackAccountEntryResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFAccAccountEntryBuff[] retBuff = new CFAccAccountEntryBuff[buffList.size()]; Iterator<CFAccAccountEntryBuff> 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.CFAccMSSql.CFAccMSSqlAddressTable.java
public void deleteAddressByCountryIdx(CFAccAuthorization Authorization, Short argCountryId) { final String S_ProcName = "deleteAddressByCountryIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w.j ava 2 s. c o m ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_delete_address_by_countryidx ?, ?, ?, ?, ?" + ", " + "?"; if (stmtDeleteByCountryIdx == null) { stmtDeleteByCountryIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtDeleteByCountryIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtDeleteByCountryIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (argCountryId != null) { stmtDeleteByCountryIdx.setShort(argIdx++, argCountryId.shortValue()); } else { stmtDeleteByCountryIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } Object stuff = null; boolean moreResults = stmtDeleteByCountryIdx.execute(); while (stuff == null) { try { moreResults = stmtDeleteByCountryIdx.getMoreResults(); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } if (moreResults) { try { stuff = stmtDeleteByCountryIdx.getResultSet(); } catch (SQLException e) { } } else if (-1 == stmtDeleteByCountryIdx.getUpdateCount()) { break; } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } }