List of usage examples for java.sql CallableStatement setLong
void setLong(String parameterName, long x) throws SQLException;
long
value. From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCurrencyTable.java
public CFEnSyntaxISOCurrencyBuff readBuffByIdIdx(CFEnSyntaxAuthorization Authorization, short Id) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null;/*from ww w . j a v a2s. com*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByIdIdx = null; try { stmtReadBuffByIdIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_iso_ccybyididx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setShort(argIdx++, Id); stmtReadBuffByIdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByIdIdx != null) { try { stmtReadBuffByIdIdx.close(); } catch (SQLException e) { } stmtReadBuffByIdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleSecAppTable.java
public CFSecuritySecAppBuff readBuffByUJEEMountIdx(CFSecurityAuthorization Authorization, long ClusterId, String JEEMountName) {//from ww w .ja v a 2 s.c om final String S_ProcName = "readBuffByUJEEMountIdx"; ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUJEEMountIdx = null; try { stmtReadBuffByUJEEMountIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_secappbyujeemountidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUJEEMountIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByUJEEMountIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUJEEMountIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUJEEMountIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUJEEMountIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUJEEMountIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUJEEMountIdx.setLong(argIdx++, ClusterId); stmtReadBuffByUJEEMountIdx.setString(argIdx++, JEEMountName); stmtReadBuffByUJEEMountIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUJEEMountIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFSecuritySecAppBuff buff = unpackSecAppResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByUJEEMountIdx != null) { try { stmtReadBuffByUJEEMountIdx.close(); } catch (SQLException e) { } stmtReadBuffByUJEEMountIdx = null; } } }
From source file:com.cws.esolutions.core.dao.impl.WebMessagingDAOImpl.java
/** * @see com.cws.esolutions.core.dao.interfaces.IWebMessagingDAO#insertMessage(List) *///from ww w.j a v a2 s .c om public synchronized boolean insertMessage(final List<Object> messageList) throws SQLException { final String methodName = IWebMessagingDAO.CNAME + "#insertMessage(final List<Object> messageList) throws SQLException"; if (DEBUG) { DEBUGGER.debug(methodName); DEBUGGER.debug("messageList: {}", messageList); } Connection sqlConn = null; CallableStatement stmt = null; boolean isComplete = false; try { sqlConn = dataSource.getConnection(); if (sqlConn.isClosed()) { throw new SQLException("Unable to obtain application datasource connection"); } sqlConn.setAutoCommit(true); stmt = sqlConn.prepareCall("{CALL submitSvcMessage(?, ?, ?, ?, ?, ?, ?, ?)}"); stmt.setString(1, (String) messageList.get(0)); // message id stmt.setString(2, (String) messageList.get(1)); // message title stmt.setString(3, (String) messageList.get(2)); // message text stmt.setString(4, (String) messageList.get(3)); // author email stmt.setBoolean(5, (Boolean) messageList.get(4)); // is active stmt.setBoolean(6, (Boolean) messageList.get(5)); // is alert stmt.setBoolean(7, (Boolean) messageList.get(6)); // does expire stmt.setLong(8, (messageList.get(7) == null) ? 0 : (Long) messageList.get(7)); // expiry date isComplete = (!(stmt.execute())); if (DEBUG) { DEBUGGER.debug("isComplete: {}", isComplete); } } catch (SQLException sqx) { ERROR_RECORDER.error(sqx.getMessage(), sqx); throw new SQLException(sqx.getMessage(), sqx); } finally { if (stmt != null) { stmt.close(); } if ((sqlConn != null) && (!(sqlConn.isClosed()))) { sqlConn.close(); } } return isComplete; }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSybase.CFAsteriskSybaseTenantTable.java
public long nextDomainIdGen(CFSecurityAuthorization Authorization, CFSecurityTenantPKey PKey) { final String S_ProcName = "nextDomainIdGen"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Not in a transaction"); }/* w w w . j a va2 s . co m*/ Connection cnx = schema.getCnx(); long Id = PKey.getRequiredId(); CallableStatement stmtSelectNextDomainIdGen = null; try { String sql = "{ call sp_next_domainidgen( ?" + ", " + "?" + " ) }"; stmtSelectNextDomainIdGen = cnx.prepareCall(sql); int argIdx = 1; stmtSelectNextDomainIdGen.registerOutParameter(argIdx++, java.sql.Types.BIGINT); stmtSelectNextDomainIdGen.setLong(argIdx++, Id); stmtSelectNextDomainIdGen.execute(); long nextId = stmtSelectNextDomainIdGen.getLong(1); return (nextId); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (stmtSelectNextDomainIdGen != null) { try { stmtSelectNextDomainIdGen.close(); } catch (SQLException e) { } stmtSelectNextDomainIdGen = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstSybase.CFAstSybaseTenantTable.java
public long nextTldIdGen(CFAstAuthorization Authorization, CFAstTenantPKey PKey) { final String S_ProcName = "nextTldIdGen"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Not in a transaction"); }/*from w w w .j a v a2 s .c o m*/ Connection cnx = schema.getCnx(); long Id = PKey.getRequiredId(); CallableStatement stmtSelectNextTldIdGen = null; try { String sql = "{ call sp_next_tldidgen( ?" + ", " + "?" + " ) }"; stmtSelectNextTldIdGen = cnx.prepareCall(sql); int argIdx = 1; stmtSelectNextTldIdGen.registerOutParameter(argIdx++, java.sql.Types.BIGINT); stmtSelectNextTldIdGen.setLong(argIdx++, Id); stmtSelectNextTldIdGen.execute(); long nextId = stmtSelectNextTldIdGen.getLong(1); return (nextId); } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (stmtSelectNextTldIdGen != null) { try { stmtSelectNextTldIdGen.close(); } catch (SQLException e) { } stmtSelectNextTldIdGen = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleContactListTable.java
public CFAccContactListBuff readBuffByIdIdx(CFAccAuthorization Authorization, long TenantId, long ContactListId) { final String S_ProcName = "readBuffByIdIdx"; ResultSet resultSet = null;// w w w .j av a2 s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByIdIdx = null; try { stmtReadBuffByIdIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_ctclstbyididx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByIdIdx.setLong(argIdx++, TenantId); stmtReadBuffByIdIdx.setLong(argIdx++, ContactListId); stmtReadBuffByIdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAccContactListBuff buff = unpackContactListResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByIdIdx != null) { try { stmtReadBuffByIdIdx.close(); } catch (SQLException e) { } stmtReadBuffByIdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleISOCurrencyTable.java
public CFAccISOCurrencyBuff readBuffByCcyCdIdx(CFAccAuthorization Authorization, String ISOCode) { final String S_ProcName = "readBuffByCcyCdIdx"; ResultSet resultSet = null;// w w w .java 2 s .c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCcyCdIdx = null; try { stmtReadBuffByCcyCdIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_ccybyccycdidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCcyCdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByCcyCdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyCdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCcyCdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCcyCdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyCdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByCcyCdIdx.setString(argIdx++, ISOCode); stmtReadBuffByCcyCdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCcyCdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAccISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByCcyCdIdx != null) { try { stmtReadBuffByCcyCdIdx.close(); } catch (SQLException e) { } stmtReadBuffByCcyCdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleISOCurrencyTable.java
public CFAccISOCurrencyBuff readBuffByCcyNmIdx(CFAccAuthorization Authorization, String Name) { final String S_ProcName = "readBuffByCcyNmIdx"; ResultSet resultSet = null;/*from w w w .j a v a2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCcyNmIdx = null; try { stmtReadBuffByCcyNmIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_ccybyccynmidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCcyNmIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByCcyNmIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyNmIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCcyNmIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCcyNmIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyNmIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByCcyNmIdx.setString(argIdx++, Name); stmtReadBuffByCcyNmIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCcyNmIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAccISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByCcyNmIdx != null) { try { stmtReadBuffByCcyNmIdx.close(); } catch (SQLException e) { } stmtReadBuffByCcyNmIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOCurrencyTable.java
public CFAstISOCurrencyBuff readBuffByCcyCdIdx(CFAstAuthorization Authorization, String ISOCode) { final String S_ProcName = "readBuffByCcyCdIdx"; ResultSet resultSet = null;/*from ww w.j a v a 2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCcyCdIdx = null; try { stmtReadBuffByCcyCdIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_ccybyccycdidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCcyCdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByCcyCdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyCdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCcyCdIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCcyCdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyCdIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByCcyCdIdx.setString(argIdx++, ISOCode); stmtReadBuffByCcyCdIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCcyCdIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByCcyCdIdx != null) { try { stmtReadBuffByCcyCdIdx.close(); } catch (SQLException e) { } stmtReadBuffByCcyCdIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOCurrencyTable.java
public CFAstISOCurrencyBuff readBuffByCcyNmIdx(CFAstAuthorization Authorization, String Name) { final String S_ProcName = "readBuffByCcyNmIdx"; ResultSet resultSet = null;/*from w w w . ja v a 2s. c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByCcyNmIdx = null; try { stmtReadBuffByCcyNmIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_iso_ccybyccynmidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByCcyNmIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByCcyNmIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyNmIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByCcyNmIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByCcyNmIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByCcyNmIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByCcyNmIdx.setString(argIdx++, Name); stmtReadBuffByCcyNmIdx.execute(); resultSet = (ResultSet) stmtReadBuffByCcyNmIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstISOCurrencyBuff buff = unpackISOCurrencyResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } return (buff); } else { return (null); } } catch (SQLException e) { return (null); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadBuffByCcyNmIdx != null) { try { stmtReadBuffByCcyNmIdx.close(); } catch (SQLException e) { } stmtReadBuffByCcyNmIdx = null; } } }