Example usage for java.sql CallableStatement close

List of usage examples for java.sql CallableStatement close

Introduction

In this page you can find the example usage for java.sql CallableStatement close.

Prototype

void close() throws SQLException;

Source Link

Document

Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.

Usage

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleSecGroupFormTable.java

public void deleteSecGroupForm(CFAstAuthorization Authorization, CFAstSecGroupFormBuff Buff) {
    final String S_ProcName = "deleteSecGroupForm";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from   w w w . j  av  a2 s. c  o m*/
        long ClusterId = Buff.getRequiredClusterId();
        long SecGroupFormId = Buff.getRequiredSecGroupFormId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_secgrpfrm( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByPKey.setLong(argIdx++, ClusterId);
        stmtDeleteByPKey.setLong(argIdx++, SecGroupFormId);
        stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision());
        ;
        stmtDeleteByPKey.execute();
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (stmtDeleteByPKey != null) {
            try {
                stmtDeleteByPKey.close();
            } catch (SQLException e) {
            }
            stmtDeleteByPKey = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleProjectBaseTable.java

public CFAccProjectBaseBuff[] readAllDerived(CFAccAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAccProjectBaseBuff[] buffArray;/*  w w w .  j a v  a 2s .  co  m*/
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    String classCode;
    ArrayList<String> classCodeList = new ArrayList<String>();
    ResultSet resultSet = null;
    CallableStatement stmtReadAllClassCode = null;
    try {
        Connection cnx = schema.getCnx();
        stmtReadAllClassCode = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".rd_bprjdefccall( ?, ?, ?, ?, ?, ? ); end;");
        int argIdx = 1;
        stmtReadAllClassCode.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadAllClassCode.execute();
        resultSet = (ResultSet) stmtReadAllClassCode.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    classCode = resultSet.getString(1);
                    classCodeList.add(classCode);
                }
            } catch (SQLException e) {
            } finally {
                if (stmtReadAllClassCode != null) {
                    try {
                        stmtReadAllClassCode.close();
                    } catch (SQLException e) {
                    }
                    stmtReadAllClassCode = 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 (stmtReadAllClassCode != null) {
            try {
                stmtReadAllClassCode.close();
            } catch (SQLException e) {
            }
            stmtReadAllClassCode = null;
        }
    }
    List<CFAccProjectBaseBuff> resultList = new LinkedList<CFAccProjectBaseBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAccProjectBaseBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("BPRJ")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("RPRJ")) {
            subList = schema.getTableRealProject().readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().readAllBuff(Authorization);
        } else if (classCode.equals("VERN")) {
            subList = schema.getTableVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MJVR")) {
            subList = schema.getTableMajorVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MNVR")) {
            subList = schema.getTableMinorVersion().readAllBuff(Authorization);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
            resultList.add(subList[idxSubList]);
        }
    }
    int idx = 0;
    buffArray = new CFAccProjectBaseBuff[resultList.size()];
    Iterator<CFAccProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleProjectBaseTable.java

public CFAstProjectBaseBuff[] readAllDerived(CFAstAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAstProjectBaseBuff[] buffArray;/*from   ww  w.j a  v a2 s  . com*/
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    String classCode;
    ArrayList<String> classCodeList = new ArrayList<String>();
    ResultSet resultSet = null;
    CallableStatement stmtReadAllClassCode = null;
    try {
        Connection cnx = schema.getCnx();
        stmtReadAllClassCode = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".rd_bprjdefccall( ?, ?, ?, ?, ?, ? ); end;");
        int argIdx = 1;
        stmtReadAllClassCode.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadAllClassCode.execute();
        resultSet = (ResultSet) stmtReadAllClassCode.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    classCode = resultSet.getString(1);
                    classCodeList.add(classCode);
                }
            } catch (SQLException e) {
            } finally {
                if (stmtReadAllClassCode != null) {
                    try {
                        stmtReadAllClassCode.close();
                    } catch (SQLException e) {
                    }
                    stmtReadAllClassCode = 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 (stmtReadAllClassCode != null) {
            try {
                stmtReadAllClassCode.close();
            } catch (SQLException e) {
            }
            stmtReadAllClassCode = null;
        }
    }
    List<CFAstProjectBaseBuff> resultList = new LinkedList<CFAstProjectBaseBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAstProjectBaseBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("BPRJ")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("RPRJ")) {
            subList = schema.getTableRealProject().readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().readAllBuff(Authorization);
        } else if (classCode.equals("VERN")) {
            subList = schema.getTableVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MJVR")) {
            subList = schema.getTableMajorVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MNVR")) {
            subList = schema.getTableMinorVersion().readAllBuff(Authorization);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
            resultList.add(subList[idxSubList]);
        }
    }
    int idx = 0;
    buffArray = new CFAstProjectBaseBuff[resultList.size()];
    Iterator<CFAstProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleProjectBaseTable.java

public CFAstProjectBaseBuff[] readAllDerived(CFAstAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAstProjectBaseBuff[] buffArray;/*from   w  w  w  . j av a 2 s  . co m*/
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    String classCode;
    ArrayList<String> classCodeList = new ArrayList<String>();
    ResultSet resultSet = null;
    CallableStatement stmtReadAllClassCode = null;
    try {
        Connection cnx = schema.getCnx();
        stmtReadAllClassCode = cnx.prepareCall(
                "begin " + schema.getLowerDbSchemaName() + ".rd_bprjdefccall( ?, ?, ?, ?, ?, ? ); end;");
        int argIdx = 1;
        stmtReadAllClassCode.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadAllClassCode.execute();
        resultSet = (ResultSet) stmtReadAllClassCode.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    classCode = resultSet.getString(1);
                    classCodeList.add(classCode);
                }
            } catch (SQLException e) {
            } finally {
                if (stmtReadAllClassCode != null) {
                    try {
                        stmtReadAllClassCode.close();
                    } catch (SQLException e) {
                    }
                    stmtReadAllClassCode = 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 (stmtReadAllClassCode != null) {
            try {
                stmtReadAllClassCode.close();
            } catch (SQLException e) {
            }
            stmtReadAllClassCode = null;
        }
    }
    List<CFAstProjectBaseBuff> resultList = new LinkedList<CFAstProjectBaseBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAstProjectBaseBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("BPRJ")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("RPRJ")) {
            subList = schema.getTableRealProject().readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().readAllBuff(Authorization);
        } else if (classCode.equals("VERN")) {
            subList = schema.getTableVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MJVR")) {
            subList = schema.getTableMajorVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MNVR")) {
            subList = schema.getTableMinorVersion().readAllBuff(Authorization);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
            resultList.add(subList[idxSubList]);
        }
    }
    int idx = 0;
    buffArray = new CFAstProjectBaseBuff[resultList.size()];
    Iterator<CFAstProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleProjectBaseTable.java

public CFFswProjectBaseBuff[] readAllDerived(CFFswAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFFswProjectBaseBuff[] buffArray;//from  w  w w.  jav a2  s.c o  m
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    String classCode;
    ArrayList<String> classCodeList = new ArrayList<String>();
    ResultSet resultSet = null;
    CallableStatement stmtReadAllClassCode = null;
    try {
        Connection cnx = schema.getCnx();
        stmtReadAllClassCode = cnx.prepareCall(
                "begin " + schema.getLowerDbSchemaName() + ".rd_bprjdefccall( ?, ?, ?, ?, ?, ? ); end;");
        int argIdx = 1;
        stmtReadAllClassCode.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadAllClassCode.execute();
        resultSet = (ResultSet) stmtReadAllClassCode.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    classCode = resultSet.getString(1);
                    classCodeList.add(classCode);
                }
            } catch (SQLException e) {
            } finally {
                if (stmtReadAllClassCode != null) {
                    try {
                        stmtReadAllClassCode.close();
                    } catch (SQLException e) {
                    }
                    stmtReadAllClassCode = 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 (stmtReadAllClassCode != null) {
            try {
                stmtReadAllClassCode.close();
            } catch (SQLException e) {
            }
            stmtReadAllClassCode = null;
        }
    }
    List<CFFswProjectBaseBuff> resultList = new LinkedList<CFFswProjectBaseBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFFswProjectBaseBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("BPRJ")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("RPRJ")) {
            subList = schema.getTableRealProject().readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().readAllBuff(Authorization);
        } else if (classCode.equals("VERN")) {
            subList = schema.getTableVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MJVR")) {
            subList = schema.getTableMajorVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MNVR")) {
            subList = schema.getTableMinorVersion().readAllBuff(Authorization);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
            resultList.add(subList[idxSubList]);
        }
    }
    int idx = 0;
    buffArray = new CFFswProjectBaseBuff[resultList.size()];
    Iterator<CFFswProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleAccountConfigTable.java

public void deleteAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) {
    final String S_ProcName = "deleteAccountConfig";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//from  w  w  w.  j a va 2  s  .  com
        long TenantId = Buff.getRequiredTenantId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".dl_acct_cfg( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtDeleteByPKey.setLong(argIdx++, TenantId);
        stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision());
        ;
        stmtDeleteByPKey.execute();
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (stmtDeleteByPKey != null) {
            try {
                stmtDeleteByPKey.close();
            } catch (SQLException e) {
            }
            stmtDeleteByPKey = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleDomainBaseTable.java

public CFInternetDomainBaseBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFInternetDomainBaseBuff[] buffArray;
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from   w  w w.j a v a2s . c  om*/
    String classCode;
    ArrayList<String> classCodeList = new ArrayList<String>();
    ResultSet resultSet = null;
    CallableStatement stmtReadAllClassCode = null;
    try {
        Connection cnx = schema.getCnx();
        stmtReadAllClassCode = cnx.prepareCall(
                "begin " + schema.getLowerDbSchemaName() + ".rd_bdomdefccall( ?, ?, ?, ?, ?, ? ); end;");
        int argIdx = 1;
        stmtReadAllClassCode.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadAllClassCode.execute();
        resultSet = (ResultSet) stmtReadAllClassCode.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    classCode = resultSet.getString(1);
                    classCodeList.add(classCode);
                }
            } catch (SQLException e) {
            } finally {
                if (stmtReadAllClassCode != null) {
                    try {
                        stmtReadAllClassCode.close();
                    } catch (SQLException e) {
                    }
                    stmtReadAllClassCode = 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 (stmtReadAllClassCode != null) {
            try {
                stmtReadAllClassCode.close();
            } catch (SQLException e) {
            }
            stmtReadAllClassCode = null;
        }
    }
    List<CFInternetDomainBaseBuff> resultList = new LinkedList<CFInternetDomainBaseBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFInternetDomainBaseBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("BDOM")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("TDOM")) {
            subList = schema.getTableTopDomain().readAllBuff(Authorization);
        } else if (classCode.equals("DOMN")) {
            subList = schema.getTableDomain().readAllBuff(Authorization);
        } else if (classCode.equals("BPRJ")) {
            subList = schema.getTableProjectBase().readAllBuff(Authorization);
        } else if (classCode.equals("RPRJ")) {
            subList = schema.getTableRealProject().readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().readAllBuff(Authorization);
        } else if (classCode.equals("VERN")) {
            subList = schema.getTableVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MJVR")) {
            subList = schema.getTableMajorVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MNVR")) {
            subList = schema.getTableMinorVersion().readAllBuff(Authorization);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
            resultList.add(subList[idxSubList]);
        }
    }
    int idx = 0;
    buffArray = new CFInternetDomainBaseBuff[resultList.size()];
    Iterator<CFInternetDomainBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleDomainBaseTable.java

public CFAccDomainBaseBuff[] readAllDerived(CFAccAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAccDomainBaseBuff[] buffArray;/*from w w w. j av  a  2 s  .  c o m*/
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    String classCode;
    ArrayList<String> classCodeList = new ArrayList<String>();
    ResultSet resultSet = null;
    CallableStatement stmtReadAllClassCode = null;
    try {
        Connection cnx = schema.getCnx();
        stmtReadAllClassCode = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".rd_bdomdefccall( ?, ?, ?, ?, ?, ? ); end;");
        int argIdx = 1;
        stmtReadAllClassCode.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadAllClassCode.execute();
        resultSet = (ResultSet) stmtReadAllClassCode.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    classCode = resultSet.getString(1);
                    classCodeList.add(classCode);
                }
            } catch (SQLException e) {
            } finally {
                if (stmtReadAllClassCode != null) {
                    try {
                        stmtReadAllClassCode.close();
                    } catch (SQLException e) {
                    }
                    stmtReadAllClassCode = 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 (stmtReadAllClassCode != null) {
            try {
                stmtReadAllClassCode.close();
            } catch (SQLException e) {
            }
            stmtReadAllClassCode = null;
        }
    }
    List<CFAccDomainBaseBuff> resultList = new LinkedList<CFAccDomainBaseBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAccDomainBaseBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("BDOM")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("TDOM")) {
            subList = schema.getTableTopDomain().readAllBuff(Authorization);
        } else if (classCode.equals("DOMN")) {
            subList = schema.getTableDomain().readAllBuff(Authorization);
        } else if (classCode.equals("BPRJ")) {
            subList = schema.getTableProjectBase().readAllBuff(Authorization);
        } else if (classCode.equals("RPRJ")) {
            subList = schema.getTableRealProject().readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().readAllBuff(Authorization);
        } else if (classCode.equals("VERN")) {
            subList = schema.getTableVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MJVR")) {
            subList = schema.getTableMajorVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MNVR")) {
            subList = schema.getTableMinorVersion().readAllBuff(Authorization);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
            resultList.add(subList[idxSubList]);
        }
    }
    int idx = 0;
    buffArray = new CFAccDomainBaseBuff[resultList.size()];
    Iterator<CFAccDomainBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleDomainBaseTable.java

public CFAstDomainBaseBuff[] readAllDerived(CFAstAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAstDomainBaseBuff[] buffArray;/*from   w  w  w  .  j a  v a 2 s  .  c o  m*/
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    String classCode;
    ArrayList<String> classCodeList = new ArrayList<String>();
    ResultSet resultSet = null;
    CallableStatement stmtReadAllClassCode = null;
    try {
        Connection cnx = schema.getCnx();
        stmtReadAllClassCode = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".rd_bdomdefccall( ?, ?, ?, ?, ?, ? ); end;");
        int argIdx = 1;
        stmtReadAllClassCode.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadAllClassCode.execute();
        resultSet = (ResultSet) stmtReadAllClassCode.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    classCode = resultSet.getString(1);
                    classCodeList.add(classCode);
                }
            } catch (SQLException e) {
            } finally {
                if (stmtReadAllClassCode != null) {
                    try {
                        stmtReadAllClassCode.close();
                    } catch (SQLException e) {
                    }
                    stmtReadAllClassCode = 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 (stmtReadAllClassCode != null) {
            try {
                stmtReadAllClassCode.close();
            } catch (SQLException e) {
            }
            stmtReadAllClassCode = null;
        }
    }
    List<CFAstDomainBaseBuff> resultList = new LinkedList<CFAstDomainBaseBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAstDomainBaseBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("BDOM")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("TDOM")) {
            subList = schema.getTableTopDomain().readAllBuff(Authorization);
        } else if (classCode.equals("DOMN")) {
            subList = schema.getTableDomain().readAllBuff(Authorization);
        } else if (classCode.equals("BPRJ")) {
            subList = schema.getTableProjectBase().readAllBuff(Authorization);
        } else if (classCode.equals("RPRJ")) {
            subList = schema.getTableRealProject().readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().readAllBuff(Authorization);
        } else if (classCode.equals("VERN")) {
            subList = schema.getTableVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MJVR")) {
            subList = schema.getTableMajorVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MNVR")) {
            subList = schema.getTableMinorVersion().readAllBuff(Authorization);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
            resultList.add(subList[idxSubList]);
        }
    }
    int idx = 0;
    buffArray = new CFAstDomainBaseBuff[resultList.size()];
    Iterator<CFAstDomainBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleDomainBaseTable.java

public CFAstDomainBaseBuff[] readAllDerived(CFAstAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAstDomainBaseBuff[] buffArray;/* w ww  .  j a v a 2  s . c o m*/
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }
    String classCode;
    ArrayList<String> classCodeList = new ArrayList<String>();
    ResultSet resultSet = null;
    CallableStatement stmtReadAllClassCode = null;
    try {
        Connection cnx = schema.getCnx();
        stmtReadAllClassCode = cnx.prepareCall(
                "begin " + schema.getLowerDbSchemaName() + ".rd_bdomdefccall( ?, ?, ?, ?, ?, ? ); end;");
        int argIdx = 1;
        stmtReadAllClassCode.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadAllClassCode.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadAllClassCode.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadAllClassCode.execute();
        resultSet = (ResultSet) stmtReadAllClassCode.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    classCode = resultSet.getString(1);
                    classCodeList.add(classCode);
                }
            } catch (SQLException e) {
            } finally {
                if (stmtReadAllClassCode != null) {
                    try {
                        stmtReadAllClassCode.close();
                    } catch (SQLException e) {
                    }
                    stmtReadAllClassCode = 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 (stmtReadAllClassCode != null) {
            try {
                stmtReadAllClassCode.close();
            } catch (SQLException e) {
            }
            stmtReadAllClassCode = null;
        }
    }
    List<CFAstDomainBaseBuff> resultList = new LinkedList<CFAstDomainBaseBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAstDomainBaseBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("BDOM")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("TDOM")) {
            subList = schema.getTableTopDomain().readAllBuff(Authorization);
        } else if (classCode.equals("DOMN")) {
            subList = schema.getTableDomain().readAllBuff(Authorization);
        } else if (classCode.equals("BPRJ")) {
            subList = schema.getTableProjectBase().readAllBuff(Authorization);
        } else if (classCode.equals("RPRJ")) {
            subList = schema.getTableRealProject().readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().readAllBuff(Authorization);
        } else if (classCode.equals("VERN")) {
            subList = schema.getTableVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MJVR")) {
            subList = schema.getTableMajorVersion().readAllBuff(Authorization);
        } else if (classCode.equals("MNVR")) {
            subList = schema.getTableMinorVersion().readAllBuff(Authorization);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
            resultList.add(subList[idxSubList]);
        }
    }
    int idx = 0;
    buffArray = new CFAstDomainBaseBuff[resultList.size()];
    Iterator<CFAstDomainBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}