List of usage examples for java.sql CallableStatement setNull
void setNull(String parameterName, int sqlType) throws SQLException;
NULL
. From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnClauseTable.java
public CFEnSyntaxEnClauseBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;//from w ww. j ava2s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnClauseBuff> buffList = new LinkedList<CFEnSyntaxEnClauseBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enclausebyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnClauseBuff buff = unpackEnClauseResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnClauseBuff[] retBuff = new CFEnSyntaxEnClauseBuff[buffList.size()]; Iterator<CFEnSyntaxEnClauseBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnPhraseTable.java
public CFEnSyntaxEnPhraseBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;/*w w w . ja v a2 s . co m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnPhraseBuff> buffList = new LinkedList<CFEnSyntaxEnPhraseBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enphrasebyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnPhraseBuff buff = unpackEnPhraseResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnPhraseBuff[] retBuff = new CFEnSyntaxEnPhraseBuff[buffList.size()]; Iterator<CFEnSyntaxEnPhraseBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnSubjectTable.java
public CFEnSyntaxEnSubjectBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;//from w w w . ja va2 s . c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnSubjectBuff> buffList = new LinkedList<CFEnSyntaxEnSubjectBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_ensubjbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnSubjectBuff buff = unpackEnSubjectResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnSubjectBuff[] retBuff = new CFEnSyntaxEnSubjectBuff[buffList.size()]; Iterator<CFEnSyntaxEnSubjectBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnSentenceTable.java
public CFEnSyntaxEnSentenceBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;/* ww w .j a v a2 s. c om*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnSentenceBuff> buffList = new LinkedList<CFEnSyntaxEnSentenceBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_ensentbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnSentenceBuff buff = unpackEnSentenceResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnSentenceBuff[] retBuff = new CFEnSyntaxEnSentenceBuff[buffList.size()]; Iterator<CFEnSyntaxEnSentenceBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnModifierTable.java
public CFEnSyntaxEnModifierBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;//from w w w . ja v a 2s .c o m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnModifierBuff> buffList = new LinkedList<CFEnSyntaxEnModifierBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enmodifbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnModifierBuff buff = unpackEnModifierResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnModifierBuff[] retBuff = new CFEnSyntaxEnModifierBuff[buffList.size()]; Iterator<CFEnSyntaxEnModifierBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnMorphemeTable.java
public CFEnSyntaxEnMorphemeBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;//from w w w.ja va 2 s . co m Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnMorphemeBuff> buffList = new LinkedList<CFEnSyntaxEnMorphemeBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enmorphbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnMorphemeBuff buff = unpackEnMorphemeResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnMorphemeBuff[] retBuff = new CFEnSyntaxEnMorphemeBuff[buffList.size()]; Iterator<CFEnSyntaxEnMorphemeBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnAuxiliaryTable.java
public CFEnSyntaxEnAuxiliaryBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;/* ww w .j a va 2 s . c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnAuxiliaryBuff> buffList = new LinkedList<CFEnSyntaxEnAuxiliaryBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enauxbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnAuxiliaryBuff buff = unpackEnAuxiliaryResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnAuxiliaryBuff[] retBuff = new CFEnSyntaxEnAuxiliaryBuff[buffList.size()]; Iterator<CFEnSyntaxEnAuxiliaryBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnDiscourseTable.java
public CFEnSyntaxEnDiscourseBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;/*from ww w.jav a 2s .c om*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnDiscourseBuff> buffList = new LinkedList<CFEnSyntaxEnDiscourseBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_endiscbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnDiscourseBuff buff = unpackEnDiscourseResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnDiscourseBuff[] retBuff = new CFEnSyntaxEnDiscourseBuff[buffList.size()]; Iterator<CFEnSyntaxEnDiscourseBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnAdjectiveTable.java
public CFEnSyntaxEnAdjectiveBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;/*w w w . ja v a2 s. c o m*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnAdjectiveBuff> buffList = new LinkedList<CFEnSyntaxEnAdjectiveBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enadjecbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnAdjectiveBuff buff = unpackEnAdjectiveResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnAdjectiveBuff[] retBuff = new CFEnSyntaxEnAdjectiveBuff[buffList.size()]; Iterator<CFEnSyntaxEnAdjectiveBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleEnAdverbialTable.java
public CFEnSyntaxEnAdverbialBuff[] readBuffByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) { final String S_ProcName = "readBuffByScopeIdx"; ResultSet resultSet = null;/* ww w . jav a 2 s . com*/ Connection cnx = schema.getCnx(); CallableStatement stmtReadBuffByScopeIdx = null; List<CFEnSyntaxEnAdverbialBuff> buffList = new LinkedList<CFEnSyntaxEnAdverbialBuff>(); try { stmtReadBuffByScopeIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_enadvblbyscopeidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadBuffByScopeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByScopeIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (ScopeId != null) { stmtReadBuffByScopeIdx.setLong(argIdx++, ScopeId.longValue()); } else { stmtReadBuffByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT); } stmtReadBuffByScopeIdx.execute(); resultSet = (ResultSet) stmtReadBuffByScopeIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { CFEnSyntaxEnAdverbialBuff buff = unpackEnAdverbialResultSetToBuff(resultSet); buffList.add(buff); } try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } catch (SQLException e) { } } int idx = 0; CFEnSyntaxEnAdverbialBuff[] retBuff = new CFEnSyntaxEnAdverbialBuff[buffList.size()]; Iterator<CFEnSyntaxEnAdverbialBuff> 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 (stmtReadBuffByScopeIdx != null) { try { stmtReadBuffByScopeIdx.close(); } catch (SQLException e) { } stmtReadBuffByScopeIdx = null; } } }