List of usage examples for java.sql CallableStatement setString
void setString(String parameterName, String x) throws SQLException;
String
value. From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOCountryTable.java
public CFFswISOCountryBuff lockBuff(CFFswAuthorization Authorization, CFFswISOCountryPKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w w w . ja va2 s. co m*/ ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtLockBuffByPKey = null; try { short Id = PKey.getRequiredId(); stmtLockBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".lck_iso_cntry( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtLockBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtLockBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtLockBuffByPKey.setShort(argIdx++, Id); stmtLockBuffByPKey.execute(); resultSet = (ResultSet) stmtLockBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFFswISOCountryBuff buff = unpackISOCountryResultSetToBuff(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 (stmtLockBuffByPKey != null) { try { stmtLockBuffByPKey.close(); } catch (SQLException e) { } stmtLockBuffByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleSecGroupTable.java
public CFAccSecGroupBuff readBuffByUNameIdx(CFAccAuthorization Authorization, long ClusterId, String Name) { final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null;//from w w w . j av a2 s .co m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_secgrpbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUNameIdx.setLong(argIdx++, ClusterId); stmtReadBuffByUNameIdx.setString(argIdx++, Name); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAccSecGroupBuff buff = unpackSecGroupResultSetToBuff(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 (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleSecGroupTable.java
public CFAstSecGroupBuff readBuffByUNameIdx(CFAstAuthorization Authorization, long ClusterId, String Name) { final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null;/*from ww w .j a v a 2 s. c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_secgrpbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUNameIdx.setLong(argIdx++, ClusterId); stmtReadBuffByUNameIdx.setString(argIdx++, Name); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstSecGroupBuff buff = unpackSecGroupResultSetToBuff(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 (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleSecGroupTable.java
public CFAstSecGroupBuff readBuffByUNameIdx(CFAstAuthorization Authorization, long ClusterId, String Name) { final String S_ProcName = "readBuffByUNameIdx"; ResultSet resultSet = null;//from w w w. j a v a 2s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByUNameIdx = null; try { stmtReadBuffByUNameIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_secgrpbyunameidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByUNameIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByUNameIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByUNameIdx.setLong(argIdx++, ClusterId); stmtReadBuffByUNameIdx.setString(argIdx++, Name); stmtReadBuffByUNameIdx.execute(); resultSet = (ResultSet) stmtReadBuffByUNameIdx.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFAstSecGroupBuff buff = unpackSecGroupResultSetToBuff(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 (stmtReadBuffByUNameIdx != null) { try { stmtReadBuffByUNameIdx.close(); } catch (SQLException e) { } stmtReadBuffByUNameIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnAuxiliaryTable.java
public CFEnSyntaxEnAuxiliaryBuff lockBuff(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnglishParsePKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }// w w w.j a v a 2 s . com ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtLockBuffByPKey = null; try { long Id = PKey.getRequiredId(); stmtLockBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".lck_enaux( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtLockBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtLockBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtLockBuffByPKey.setLong(argIdx++, Id); stmtLockBuffByPKey.execute(); resultSet = (ResultSet) stmtLockBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnAuxiliaryBuff buff = unpackEnAuxiliaryResultSetToBuff(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 (stmtLockBuffByPKey != null) { try { stmtLockBuffByPKey.close(); } catch (SQLException e) { } stmtLockBuffByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnDiscourseTable.java
public CFEnSyntaxEnDiscourseBuff readBuff(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnglishParsePKey PKey) { final String S_ProcName = "readBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from www .ja v a2s .co m*/ ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByPKey = null; try { long Id = PKey.getRequiredId(); stmtReadBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_endisc( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByPKey.setLong(argIdx++, Id); stmtReadBuffByPKey.execute(); resultSet = (ResultSet) stmtReadBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnDiscourseBuff buff = unpackEnDiscourseResultSetToBuff(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 (stmtReadBuffByPKey != null) { try { stmtReadBuffByPKey.close(); } catch (SQLException e) { } stmtReadBuffByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnModifierTable.java
public CFEnSyntaxEnModifierBuff readBuff(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnglishParsePKey PKey) { final String S_ProcName = "readBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//w w w . java2 s .c om ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByPKey = null; try { long Id = PKey.getRequiredId(); stmtReadBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enmodif( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByPKey.setLong(argIdx++, Id); stmtReadBuffByPKey.execute(); resultSet = (ResultSet) stmtReadBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnModifierBuff buff = unpackEnModifierResultSetToBuff(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 (stmtReadBuffByPKey != null) { try { stmtReadBuffByPKey.close(); } catch (SQLException e) { } stmtReadBuffByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnMorphemeTable.java
public CFEnSyntaxEnMorphemeBuff readBuff(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnglishParsePKey PKey) { final String S_ProcName = "readBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w .ja v a2 s. c om ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByPKey = null; try { long Id = PKey.getRequiredId(); stmtReadBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enmorph( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadBuffByPKey.setLong(argIdx++, Id); stmtReadBuffByPKey.execute(); resultSet = (ResultSet) stmtReadBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnMorphemeBuff buff = unpackEnMorphemeResultSetToBuff(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 (stmtReadBuffByPKey != null) { try { stmtReadBuffByPKey.close(); } catch (SQLException e) { } stmtReadBuffByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnSentenceTable.java
public CFEnSyntaxEnSentenceBuff lockBuff(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnglishParsePKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }// w w w.j a v a 2s.c o m ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtLockBuffByPKey = null; try { long Id = PKey.getRequiredId(); stmtLockBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".lck_ensent( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtLockBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtLockBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtLockBuffByPKey.setLong(argIdx++, Id); stmtLockBuffByPKey.execute(); resultSet = (ResultSet) stmtLockBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnSentenceBuff buff = unpackEnSentenceResultSetToBuff(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 (stmtLockBuffByPKey != null) { try { stmtLockBuffByPKey.close(); } catch (SQLException e) { } stmtLockBuffByPKey = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnSubjectTable.java
public CFEnSyntaxEnSubjectBuff lockBuff(CFEnSyntaxAuthorization Authorization, CFEnSyntaxEnglishParsePKey PKey) { final String S_ProcName = "lockBuff"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w ww . ja va 2s .co m*/ ResultSet resultSet = null; Connection cnx = schema.getCnx(); CallableStatement stmtLockBuffByPKey = null; try { long Id = PKey.getRequiredId(); stmtLockBuffByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".lck_ensubj( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtLockBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtLockBuffByPKey.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtLockBuffByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtLockBuffByPKey.setLong(argIdx++, Id); stmtLockBuffByPKey.execute(); resultSet = (ResultSet) stmtLockBuffByPKey.getObject(1); if (resultSet == null) { return (null); } try { if (resultSet.next()) { CFEnSyntaxEnSubjectBuff buff = unpackEnSubjectResultSetToBuff(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 (stmtLockBuffByPKey != null) { try { stmtLockBuffByPKey.close(); } catch (SQLException e) { } stmtLockBuffByPKey = null; } } }