List of usage examples for java.sql CallableStatement setShort
void setShort(String parameterName, short x) throws SQLException;
short
value. From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleContactTable.java
public CFAccContactBuff[] readBuffByTimezoneIdx(CFAccAuthorization Authorization, Short ISOTimezoneId) { final String S_ProcName = "readBuffByTimezoneIdx"; ResultSet resultSet = null;// www . ja va 2 s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByTimezoneIdx = null; List<CFAccContactBuff> buffList = new LinkedList<CFAccContactBuff>(); try { stmtReadBuffByTimezoneIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_contactbytimezoneidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByTimezoneIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByTimezoneIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByTimezoneIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ISOTimezoneId != null) { stmtReadBuffByTimezoneIdx.setShort(argIdx++, ISOTimezoneId.shortValue()); } else { stmtReadBuffByTimezoneIdx.setNull(argIdx++, java.sql.Types.SMALLINT); } stmtReadBuffByTimezoneIdx.execute(); resultSet = (ResultSet) stmtReadBuffByTimezoneIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFAccContactBuff buff = unpackContactResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFAccContactBuff[] retBuff = new CFAccContactBuff[buffList.size()]; Iterator<CFAccContactBuff> 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 (stmtReadBuffByTimezoneIdx != null) { try { stmtReadBuffByTimezoneIdx.close(); } catch (SQLException e) { } stmtReadBuffByTimezoneIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSofiaTable.java
public void updateFSSofia(CFFswAuthorization Authorization, CFFswFSSofiaBuff Buff) { final String S_ProcName = "updateFSSofia"; ResultSet resultSet = null;//from ww w. jav a2 s . co m Connection cnx = schema.getCnx(); CallableStatement stmtUpdateByPKey = null; List<CFFswFSSofiaBuff> buffList = new LinkedList<CFFswFSSofiaBuff>(); try { long TenantId = Buff.getRequiredTenantId(); long FSSofiaId = Buff.getRequiredFSSofiaId(); String Name = Buff.getRequiredName(); short LogLevel = Buff.getRequiredLogLevel(); boolean AutoRestart = Buff.getRequiredAutoRestart(); int DebugPresence = Buff.getRequiredDebugPresence(); int Revision = Buff.getRequiredRevision(); stmtUpdateByPKey = cnx.prepareCall( "begin " + schema.getLowerDbSchemaName() + ".upd_fssofia( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "? ); 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++, "FSSF"); stmtUpdateByPKey.setLong(argIdx++, TenantId); stmtUpdateByPKey.setLong(argIdx++, FSSofiaId); stmtUpdateByPKey.setString(argIdx++, Name); stmtUpdateByPKey.setShort(argIdx++, LogLevel); if (AutoRestart) { stmtUpdateByPKey.setString(argIdx++, "Y"); } else { stmtUpdateByPKey.setString(argIdx++, "N"); } stmtUpdateByPKey.setInt(argIdx++, DebugPresence); stmtUpdateByPKey.setInt(argIdx++, Revision); stmtUpdateByPKey.execute(); resultSet = (ResultSet) stmtUpdateByPKey.getObject(1); if (resultSet != null) { try { if (resultSet.next()) { CFFswFSSofiaBuff updatedBuff = unpackFSSofiaResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredName(updatedBuff.getRequiredName()); Buff.setRequiredLogLevel(updatedBuff.getRequiredLogLevel()); Buff.setRequiredAutoRestart(updatedBuff.getRequiredAutoRestart()); Buff.setRequiredDebugPresence(updatedBuff.getRequiredDebugPresence()); 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_fssofia() 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_fssofia() did not return a result cursor"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtUpdateByPKey != null) { try { stmtUpdateByPKey.close(); } catch (SQLException e) { } stmtUpdateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleServiceTable.java
public CFSecurityServiceBuff readBuffByUHostPortIdx(CFSecurityAuthorization Authorization, long ClusterId, long HostNodeId, short HostPort) { final String S_ProcName = "readBuffByUHostPortIdx"; ResultSet resultSet = null;//from w w w . j a v a 2s. co m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUHostPortIdx = null; try { stmtReadBuffByUHostPortIdx = cnx.prepareCall( "begin " + schema.getLowerDbSchemaName() + ".rd_hostsvcbyuhostportidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUHostPortIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUHostPortIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUHostPortIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, ClusterId); stmtReadBuffByUHostPortIdx.setLong(argIdx++, HostNodeId); stmtReadBuffByUHostPortIdx.setShort(argIdx++, HostPort); stmtReadBuffByUHostPortIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUHostPortIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFSecurityServiceBuff buff = unpackServiceResultSetToBuff(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 (stmtReadBuffByUHostPortIdx != null) { try { stmtReadBuffByUHostPortIdx.close(); } catch (SQLException e) { } stmtReadBuffByUHostPortIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleServiceTable.java
public CFAccServiceBuff readBuffByUHostPortIdx(CFAccAuthorization Authorization, long ClusterId, long HostNodeId, short HostPort) { final String S_ProcName = "readBuffByUHostPortIdx"; ResultSet resultSet = null;/*from ww w .j a v a 2 s . com*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUHostPortIdx = null; try { stmtReadBuffByUHostPortIdx = cnx.prepareCall( "begin " + schema.getLowerSchemaDbName() + ".rd_hostsvcbyuhostportidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUHostPortIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUHostPortIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUHostPortIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, ClusterId); stmtReadBuffByUHostPortIdx.setLong(argIdx++, HostNodeId); stmtReadBuffByUHostPortIdx.setShort(argIdx++, HostPort); stmtReadBuffByUHostPortIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUHostPortIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAccServiceBuff buff = unpackServiceResultSetToBuff(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 (stmtReadBuffByUHostPortIdx != null) { try { stmtReadBuffByUHostPortIdx.close(); } catch (SQLException e) { } stmtReadBuffByUHostPortIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleServiceTable.java
public CFAstServiceBuff readBuffByUHostPortIdx(CFAstAuthorization Authorization, long ClusterId, long HostNodeId, short HostPort) { final String S_ProcName = "readBuffByUHostPortIdx"; ResultSet resultSet = null;// w w w .ja v a 2 s .c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUHostPortIdx = null; try { stmtReadBuffByUHostPortIdx = cnx.prepareCall( "begin " + schema.getLowerSchemaDbName() + ".rd_hostsvcbyuhostportidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUHostPortIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUHostPortIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUHostPortIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, ClusterId); stmtReadBuffByUHostPortIdx.setLong(argIdx++, HostNodeId); stmtReadBuffByUHostPortIdx.setShort(argIdx++, HostPort); stmtReadBuffByUHostPortIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUHostPortIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstServiceBuff buff = unpackServiceResultSetToBuff(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 (stmtReadBuffByUHostPortIdx != null) { try { stmtReadBuffByUHostPortIdx.close(); } catch (SQLException e) { } stmtReadBuffByUHostPortIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleServiceTable.java
public CFAstServiceBuff readBuffByUHostPortIdx(CFAstAuthorization Authorization, long ClusterId, long HostNodeId, short HostPort) { final String S_ProcName = "readBuffByUHostPortIdx"; ResultSet resultSet = null;// ww w.j a v a 2 s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUHostPortIdx = null; try { stmtReadBuffByUHostPortIdx = cnx.prepareCall( "begin " + schema.getLowerDbSchemaName() + ".rd_hostsvcbyuhostportidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUHostPortIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUHostPortIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUHostPortIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUHostPortIdx.setLong(argIdx++, ClusterId); stmtReadBuffByUHostPortIdx.setLong(argIdx++, HostNodeId); stmtReadBuffByUHostPortIdx.setShort(argIdx++, HostPort); stmtReadBuffByUHostPortIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUHostPortIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstServiceBuff buff = unpackServiceResultSetToBuff(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 (stmtReadBuffByUHostPortIdx != null) { try { stmtReadBuffByUHostPortIdx.close(); } catch (SQLException e) { } stmtReadBuffByUHostPortIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleISOTimezoneTable.java
public void createISOTimezone(CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) { final String S_ProcName = "createISOTimezone"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w ww . ja va2 s. c o m ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short ISOTimezoneId = Buff.getRequiredISOTimezoneId(); String Iso8601 = Buff.getRequiredIso8601(); String TZName = Buff.getRequiredTZName(); short TZHourOffset = Buff.getRequiredTZHourOffset(); short TZMinOffset = Buff.getRequiredTZMinOffset(); String Description = Buff.getRequiredDescription(); boolean Visible = Buff.getRequiredVisible(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall( "begin " + schema.getLowerDbSchemaName() + ".crt_isotz( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, "ITZN"); stmtCreateByPKey.setShort(argIdx++, ISOTimezoneId); stmtCreateByPKey.setString(argIdx++, Iso8601); stmtCreateByPKey.setString(argIdx++, TZName); stmtCreateByPKey.setShort(argIdx++, TZHourOffset); stmtCreateByPKey.setShort(argIdx++, TZMinOffset); stmtCreateByPKey.setString(argIdx++, Description); if (Visible) { stmtCreateByPKey.setString(argIdx++, "Y"); } else { stmtCreateByPKey.setString(argIdx++, "N"); } stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_isotz() did not return a result set"); } try { if (resultSet.next()) { CFSecurityISOTimezoneBuff createdBuff = unpackISOTimezoneResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredISOTimezoneId(createdBuff.getRequiredISOTimezoneId()); Buff.setRequiredIso8601(createdBuff.getRequiredIso8601()); Buff.setRequiredTZName(createdBuff.getRequiredTZName()); Buff.setRequiredTZHourOffset(createdBuff.getRequiredTZHourOffset()); Buff.setRequiredTZMinOffset(createdBuff.getRequiredTZMinOffset()); Buff.setRequiredDescription(createdBuff.getRequiredDescription()); Buff.setRequiredVisible(createdBuff.getRequiredVisible()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); Buff.setCreatedByUserId(createdBuff.getCreatedByUserId()); Buff.setCreatedAt(createdBuff.getCreatedAt()); Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId()); Buff.setUpdatedAt(createdBuff.getUpdatedAt()); } 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, "crt_isotz() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleISOTimezoneTable.java
public void createISOTimezone(CFAccAuthorization Authorization, CFAccISOTimezoneBuff Buff) { final String S_ProcName = "createISOTimezone"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w w w. jav a2 s. c om*/ ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short ISOTimezoneId = Buff.getRequiredISOTimezoneId(); String Iso8601 = Buff.getRequiredIso8601(); String TZName = Buff.getRequiredTZName(); short TZHourOffset = Buff.getRequiredTZHourOffset(); short TZMinOffset = Buff.getRequiredTZMinOffset(); String Description = Buff.getRequiredDescription(); boolean Visible = Buff.getRequiredVisible(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall( "begin " + schema.getLowerSchemaDbName() + ".crt_isotz( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, "ITZN"); stmtCreateByPKey.setShort(argIdx++, ISOTimezoneId); stmtCreateByPKey.setString(argIdx++, Iso8601); stmtCreateByPKey.setString(argIdx++, TZName); stmtCreateByPKey.setShort(argIdx++, TZHourOffset); stmtCreateByPKey.setShort(argIdx++, TZMinOffset); stmtCreateByPKey.setString(argIdx++, Description); if (Visible) { stmtCreateByPKey.setString(argIdx++, "Y"); } else { stmtCreateByPKey.setString(argIdx++, "N"); } stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_isotz() did not return a result set"); } try { if (resultSet.next()) { CFAccISOTimezoneBuff createdBuff = unpackISOTimezoneResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredISOTimezoneId(createdBuff.getRequiredISOTimezoneId()); Buff.setRequiredIso8601(createdBuff.getRequiredIso8601()); Buff.setRequiredTZName(createdBuff.getRequiredTZName()); Buff.setRequiredTZHourOffset(createdBuff.getRequiredTZHourOffset()); Buff.setRequiredTZMinOffset(createdBuff.getRequiredTZMinOffset()); Buff.setRequiredDescription(createdBuff.getRequiredDescription()); Buff.setRequiredVisible(createdBuff.getRequiredVisible()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); Buff.setCreatedByUserId(createdBuff.getCreatedByUserId()); Buff.setCreatedAt(createdBuff.getCreatedAt()); Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId()); Buff.setUpdatedAt(createdBuff.getUpdatedAt()); } 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, "crt_isotz() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleISOTimezoneTable.java
public void createISOTimezone(CFAstAuthorization Authorization, CFAstISOTimezoneBuff Buff) { final String S_ProcName = "createISOTimezone"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w ww . ja va 2 s .co m*/ ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short ISOTimezoneId = Buff.getRequiredISOTimezoneId(); String Iso8601 = Buff.getRequiredIso8601(); String TZName = Buff.getRequiredTZName(); short TZHourOffset = Buff.getRequiredTZHourOffset(); short TZMinOffset = Buff.getRequiredTZMinOffset(); String Description = Buff.getRequiredDescription(); boolean Visible = Buff.getRequiredVisible(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall( "begin " + schema.getLowerSchemaDbName() + ".crt_isotz( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, "ITZN"); stmtCreateByPKey.setShort(argIdx++, ISOTimezoneId); stmtCreateByPKey.setString(argIdx++, Iso8601); stmtCreateByPKey.setString(argIdx++, TZName); stmtCreateByPKey.setShort(argIdx++, TZHourOffset); stmtCreateByPKey.setShort(argIdx++, TZMinOffset); stmtCreateByPKey.setString(argIdx++, Description); if (Visible) { stmtCreateByPKey.setString(argIdx++, "Y"); } else { stmtCreateByPKey.setString(argIdx++, "N"); } stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_isotz() did not return a result set"); } try { if (resultSet.next()) { CFAstISOTimezoneBuff createdBuff = unpackISOTimezoneResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredISOTimezoneId(createdBuff.getRequiredISOTimezoneId()); Buff.setRequiredIso8601(createdBuff.getRequiredIso8601()); Buff.setRequiredTZName(createdBuff.getRequiredTZName()); Buff.setRequiredTZHourOffset(createdBuff.getRequiredTZHourOffset()); Buff.setRequiredTZMinOffset(createdBuff.getRequiredTZMinOffset()); Buff.setRequiredDescription(createdBuff.getRequiredDescription()); Buff.setRequiredVisible(createdBuff.getRequiredVisible()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); Buff.setCreatedByUserId(createdBuff.getCreatedByUserId()); Buff.setCreatedAt(createdBuff.getCreatedAt()); Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId()); Buff.setUpdatedAt(createdBuff.getUpdatedAt()); } 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, "crt_isotz() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleISOTimezoneTable.java
public void createISOTimezone(CFAstAuthorization Authorization, CFAstISOTimezoneBuff Buff) { final String S_ProcName = "createISOTimezone"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from www .jav a 2 s . c om*/ ResultSet resultSet = null; CallableStatement stmtCreateByPKey = null; try { short ISOTimezoneId = Buff.getRequiredISOTimezoneId(); String Iso8601 = Buff.getRequiredIso8601(); String TZName = Buff.getRequiredTZName(); short TZHourOffset = Buff.getRequiredTZHourOffset(); short TZMinOffset = Buff.getRequiredTZMinOffset(); String Description = Buff.getRequiredDescription(); boolean Visible = Buff.getRequiredVisible(); Connection cnx = schema.getCnx(); stmtCreateByPKey = cnx.prepareCall( "begin " + schema.getLowerDbSchemaName() + ".crt_isotz( ?, ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtCreateByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtCreateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtCreateByPKey.setString(argIdx++, "ITZN"); stmtCreateByPKey.setShort(argIdx++, ISOTimezoneId); stmtCreateByPKey.setString(argIdx++, Iso8601); stmtCreateByPKey.setString(argIdx++, TZName); stmtCreateByPKey.setShort(argIdx++, TZHourOffset); stmtCreateByPKey.setShort(argIdx++, TZMinOffset); stmtCreateByPKey.setString(argIdx++, Description); if (Visible) { stmtCreateByPKey.setString(argIdx++, "Y"); } else { stmtCreateByPKey.setString(argIdx++, "N"); } stmtCreateByPKey.execute(); resultSet = (ResultSet) stmtCreateByPKey.getObject(1); if (resultSet == null) { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "crt_isotz() did not return a result set"); } try { if (resultSet.next()) { CFAstISOTimezoneBuff createdBuff = unpackISOTimezoneResultSetToBuff(resultSet); if (resultSet.next()) { resultSet.last(); throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response, " + resultSet.getRow() + " rows selected"); } Buff.setRequiredISOTimezoneId(createdBuff.getRequiredISOTimezoneId()); Buff.setRequiredIso8601(createdBuff.getRequiredIso8601()); Buff.setRequiredTZName(createdBuff.getRequiredTZName()); Buff.setRequiredTZHourOffset(createdBuff.getRequiredTZHourOffset()); Buff.setRequiredTZMinOffset(createdBuff.getRequiredTZMinOffset()); Buff.setRequiredDescription(createdBuff.getRequiredDescription()); Buff.setRequiredVisible(createdBuff.getRequiredVisible()); Buff.setRequiredRevision(createdBuff.getRequiredRevision()); Buff.setCreatedByUserId(createdBuff.getCreatedByUserId()); Buff.setCreatedAt(createdBuff.getCreatedAt()); Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId()); Buff.setUpdatedAt(createdBuff.getUpdatedAt()); } 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, "crt_isotz() did not return a valid result set"); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtCreateByPKey != null) { try { stmtCreateByPKey.close(); } catch (SQLException e) { } stmtCreateByPKey = null; } } }