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.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSFExtensionTable.java

public void deleteFSSFExtension(CFFswAuthorization Authorization, CFFswFSSFExtensionBuff Buff) {
    final String S_ProcName = "deleteFSSFExtension";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//from w w w.jav  a2  s  .  co  m
        long TenantId = Buff.getRequiredTenantId();
        long FSSFExtensionId = Buff.getRequiredFSSFExtensionId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_fssfext( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setLong(argIdx++, FSSFExtensionId);
        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.CFAccOracleVersionTable.java

public CFAccVersionBuff[] readAllDerived(CFAccAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAccVersionBuff[] buffArray;//w  w w.j a  v a  2s .  c om
    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_verndefccall( ?, ?, ?, ?, ?, ? ); 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<CFAccVersionBuff> resultList = new LinkedList<CFAccVersionBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAccVersionBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("VERN")) {
            subList = 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 CFAccVersionBuff[resultList.size()];
    Iterator<CFAccVersionBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

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

public CFAstVersionBuff[] readAllDerived(CFAstAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAstVersionBuff[] buffArray;// w w  w  . j  ava 2s  . 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_verndefccall( ?, ?, ?, ?, ?, ? ); 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<CFAstVersionBuff> resultList = new LinkedList<CFAstVersionBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAstVersionBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("VERN")) {
            subList = 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 CFAstVersionBuff[resultList.size()];
    Iterator<CFAstVersionBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

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

public CFAstVersionBuff[] readAllDerived(CFAstAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAstVersionBuff[] buffArray;//from   w ww  . ja  v a2  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_verndefccall( ?, ?, ?, ?, ?, ? ); 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<CFAstVersionBuff> resultList = new LinkedList<CFAstVersionBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAstVersionBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("VERN")) {
            subList = 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 CFAstVersionBuff[resultList.size()];
    Iterator<CFAstVersionBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

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

public CFAccRealProjectBuff[] readAllDerived(CFAccAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAccRealProjectBuff[] buffArray;//from ww w. j  a va 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_rprjdefccall( ?, ?, ?, ?, ?, ? ); 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<CFAccRealProjectBuff> resultList = new LinkedList<CFAccRealProjectBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAccRealProjectBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("RPRJ")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().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 CFAccRealProjectBuff[resultList.size()];
    Iterator<CFAccRealProjectBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

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

public CFAstRealProjectBuff[] readAllDerived(CFAstAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAstRealProjectBuff[] buffArray;/*from w ww.  j  a  va  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_rprjdefccall( ?, ?, ?, ?, ?, ? ); 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<CFAstRealProjectBuff> resultList = new LinkedList<CFAstRealProjectBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAstRealProjectBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("RPRJ")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().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 CFAstRealProjectBuff[resultList.size()];
    Iterator<CFAstRealProjectBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

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

public CFAstRealProjectBuff[] readAllDerived(CFAstAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFAstRealProjectBuff[] buffArray;/*from ww w  . j  a va2 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_rprjdefccall( ?, ?, ?, ?, ?, ? ); 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<CFAstRealProjectBuff> resultList = new LinkedList<CFAstRealProjectBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFAstRealProjectBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("RPRJ")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().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 CFAstRealProjectBuff[resultList.size()];
    Iterator<CFAstRealProjectBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

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

public CFFswRealProjectBuff[] readAllDerived(CFFswAuthorization Authorization) {
    final String S_ProcName = "readAllDerived";
    CFFswRealProjectBuff[] buffArray;//from   www. j  av a  2 s  .c om
    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_rprjdefccall( ?, ?, ?, ?, ?, ? ); 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<CFFswRealProjectBuff> resultList = new LinkedList<CFFswRealProjectBuff>();
    for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
        CFFswRealProjectBuff[] subList;
        classCode = classCodeList.get(classCodeIdx);
        if (classCode.equals("RPRJ")) {
            subList = readAllBuff(Authorization);
        } else if (classCode.equals("TPRJ")) {
            subList = schema.getTableTopProject().readAllBuff(Authorization);
        } else if (classCode.equals("SPRJ")) {
            subList = schema.getTableSubProject().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 CFFswRealProjectBuff[resultList.size()];
    Iterator<CFFswRealProjectBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        buffArray[idx++] = iter.next();
    }
    return (buffArray);
}

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

public void deleteCluster(CFAstAuthorization Authorization, CFAstClusterBuff Buff) {
    final String S_ProcName = "deleteCluster";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/* w  w  w.  j av a2 s.com*/
        long Id = Buff.getRequiredId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".dl_clus( ?, ?, ?, ?, ?"
                + ", " + "?" + ", " + "?" + " ); 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++, Id);
        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.CFAsteriskOracleServiceTable.java

public void deleteService(CFSecurityAuthorization Authorization, CFSecurityServiceBuff Buff) {
    final String S_ProcName = "deleteService";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*  w  w  w.  j av a 2  s  .  c om*/
        long ClusterId = Buff.getRequiredClusterId();
        long ServiceId = Buff.getRequiredServiceId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_hostsvc( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, ServiceId);
        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;
        }
    }
}