Example usage for java.sql Types BIGINT

List of usage examples for java.sql Types BIGINT

Introduction

In this page you can find the example usage for java.sql Types BIGINT.

Prototype

int BIGINT

To view the source code for java.sql Types BIGINT.

Click Source Link

Document

The constant in the Java programming language, sometimes referred to as a type code, that identifies the generic SQL type BIGINT.

Usage

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_1.CFEnSyntaxMySql.CFEnSyntaxMySqlEnComplementTable.java

public void deleteEnComplementByScopeIdx(CFEnSyntaxAuthorization Authorization, Long argScopeId) {
    final String S_ProcName = "deleteEnComplementByScopeIdx";
    ResultSet resultSet = null;/*from w  ww  . j  a v a 2s. c  o m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName() + ".sp_delete_encompl_by_scopeidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " )";
        if (stmtDeleteByScopeIdx == null) {
            stmtDeleteByScopeIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (argScopeId != null) {
            stmtDeleteByScopeIdx.setLong(argIdx++, argScopeId.longValue());
        } else {
            stmtDeleteByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtDeleteByScopeIdx.executeUpdate();
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnDeterminerTable.java

public void deleteEnDeterminerByScopeIdx(CFEnSyntaxAuthorization Authorization, Long argScopeId) {
    final String S_ProcName = "deleteEnDeterminerByScopeIdx";
    ResultSet resultSet = null;/*from   ww  w  . j a  v  a 2  s.  co m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName() + ".sp_delete_endeter_by_scopeidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " )";
        if (stmtDeleteByScopeIdx == null) {
            stmtDeleteByScopeIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (argScopeId != null) {
            stmtDeleteByScopeIdx.setLong(argIdx++, argScopeId.longValue());
        } else {
            stmtDeleteByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtDeleteByScopeIdx.executeUpdate();
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnPrepositionTable.java

public void deleteEnPrepositionByScopeIdx(CFEnSyntaxAuthorization Authorization, Long argScopeId) {
    final String S_ProcName = "deleteEnPrepositionByScopeIdx";
    ResultSet resultSet = null;/* w  ww  . j av a  2s  .  c om*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName() + ".sp_delete_enprep_by_scopeidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " )";
        if (stmtDeleteByScopeIdx == null) {
            stmtDeleteByScopeIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (argScopeId != null) {
            stmtDeleteByScopeIdx.setLong(argIdx++, argScopeId.longValue());
        } else {
            stmtDeleteByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtDeleteByScopeIdx.executeUpdate();
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnIntensifierTable.java

public void deleteEnIntensifierByScopeIdx(CFEnSyntaxAuthorization Authorization, Long argScopeId) {
    final String S_ProcName = "deleteEnIntensifierByScopeIdx";
    ResultSet resultSet = null;/*from   ww  w  . j  a  v a 2s.co m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName() + ".sp_delete_enintens_by_scopeidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " )";
        if (stmtDeleteByScopeIdx == null) {
            stmtDeleteByScopeIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByScopeIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (argScopeId != null) {
            stmtDeleteByScopeIdx.setLong(argIdx++, argScopeId.longValue());
        } else {
            stmtDeleteByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtDeleteByScopeIdx.executeUpdate();
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnglishParseTable.java

public CFEnSyntaxEnglishParseBuff[] readDerivedByScopeIdx(CFEnSyntaxAuthorization Authorization, Long ScopeId) {
    final String S_ProcName = "readDerivedByScopeIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from  w  w w .j av a2 s.c  o m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName() + ".sp_read_enparse_cc_by_scopeidx( ?, ?, ?, ?, ?"
                + ", " + "?" + " )";
        if (stmtReadClassCodeByScopeIdx == null) {
            stmtReadClassCodeByScopeIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByScopeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByScopeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByScopeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByScopeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (ScopeId != null) {
            stmtReadClassCodeByScopeIdx.setLong(argIdx++, ScopeId.longValue());
        } else {
            stmtReadClassCodeByScopeIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        try {
            resultSet = stmtReadClassCodeByScopeIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        while ((resultSet != null) && resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFEnSyntaxEnglishParseBuff> resultList = new LinkedList<CFEnSyntaxEnglishParseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("ENPS")) {
            CFEnSyntaxEnglishParseBuff[] subList = readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENDS")) {
            CFEnSyntaxEnDiscourseBuff[] subList = schema.getTableEnDiscourse().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENSN")) {
            CFEnSyntaxEnSentenceBuff[] subList = schema.getTableEnSentence().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENCL")) {
            CFEnSyntaxEnClauseBuff[] subList = schema.getTableEnClause().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENPH")) {
            CFEnSyntaxEnPhraseBuff[] subList = schema.getTableEnPhrase().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENWD")) {
            CFEnSyntaxEnWordBuff[] subList = schema.getTableEnWord().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENPR")) {
            CFEnSyntaxEnPrepositionBuff[] subList = schema.getTableEnPreposition()
                    .readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENMP")) {
            CFEnSyntaxEnMorphemeBuff[] subList = schema.getTableEnMorpheme().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENSJ")) {
            CFEnSyntaxEnSubjectBuff[] subList = schema.getTableEnSubject().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENOB")) {
            CFEnSyntaxEnObjectBuff[] subList = schema.getTableEnObject().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENCM")) {
            CFEnSyntaxEnComplementBuff[] subList = schema.getTableEnComplement()
                    .readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENVL")) {
            CFEnSyntaxEnAdverbialBuff[] subList = schema.getTableEnAdverbial().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENAD")) {
            CFEnSyntaxEnAdjectiveBuff[] subList = schema.getTableEnAdjective().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENTS")) {
            CFEnSyntaxEnTenseBuff[] subList = schema.getTableEnTense().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENAX")) {
            CFEnSyntaxEnAuxiliaryBuff[] subList = schema.getTableEnAuxiliary().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENCN")) {
            CFEnSyntaxEnConnectiveBuff[] subList = schema.getTableEnConnective()
                    .readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENDT")) {
            CFEnSyntaxEnDeterminerBuff[] subList = schema.getTableEnDeterminer()
                    .readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENHD")) {
            CFEnSyntaxEnHeadBuff[] subList = schema.getTableEnHead().readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("ENIN")) {
            CFEnSyntaxEnIntensifierBuff[] subList = schema.getTableEnIntensifier()
                    .readBuffByScopeIdx(Authorization, ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("EMOD")) {
            CFEnSyntaxEnModifierBuff[] subList = schema.getTableEnModifier().readBuffByScopeIdx(Authorization,
                    ScopeId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    int idx = 0;
    CFEnSyntaxEnglishParseBuff[] retBuff = new CFEnSyntaxEnglishParseBuff[resultList.size()];
    Iterator<CFEnSyntaxEnglishParseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

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

public CFAccAccountBuff[] readBuffByRollupAcctIdx(CFAccAuthorization Authorization, Long RollupTenantId,
        Long RollupAccountId) {/*  ww  w .  j  a v a2 s  .co  m*/
    final String S_ProcName = "readBuffByRollupAcctIdx";
    ResultSet resultSet = null;
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByRollupAcctIdx = null;
    List<CFAccAccountBuff> buffList = new LinkedList<CFAccAccountBuff>();
    try {
        stmtReadBuffByRollupAcctIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".rd_acctbyrollupacctidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByRollupAcctIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByRollupAcctIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByRollupAcctIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByRollupAcctIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByRollupAcctIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByRollupAcctIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (RollupTenantId != null) {
            stmtReadBuffByRollupAcctIdx.setLong(argIdx++, RollupTenantId.longValue());
        } else {
            stmtReadBuffByRollupAcctIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (RollupAccountId != null) {
            stmtReadBuffByRollupAcctIdx.setLong(argIdx++, RollupAccountId.longValue());
        } else {
            stmtReadBuffByRollupAcctIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtReadBuffByRollupAcctIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByRollupAcctIdx.getObject(1);
        if (resultSet != null) {
            try {
                while (resultSet.next()) {
                    CFAccAccountBuff buff = unpackAccountResultSetToBuff(resultSet);
                    buffList.add(buff);
                }
                try {
                    resultSet.close();
                } catch (SQLException e) {
                }
                resultSet = null;
            } catch (SQLException e) {
            }
        }
        int idx = 0;
        CFAccAccountBuff[] retBuff = new CFAccAccountBuff[buffList.size()];
        Iterator<CFAccAccountBuff> 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 (stmtReadBuffByRollupAcctIdx != null) {
            try {
                stmtReadBuffByRollupAcctIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByRollupAcctIdx = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMSSql.CFAccMSSqlAccountConfigTable.java

public CFAccAccountConfigBuff[] readBuffByCustCtcLstIdx(CFAccAuthorization Authorization,
        Long CustContactListTenantId, Long CustContactListId) {
    final String S_ProcName = "readBuffByCustCtcLstIdx";
    ResultSet resultSet = null;/*from www  .  j  a v  a2s.c  o  m*/
    try {
        Connection cnx = schema.getCnx();
        String sql = "{ call sp_read_acct_cfg_by_custctclstidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?"
                + " ) }";
        if (stmtReadBuffByCustCtcLstIdx == null) {
            stmtReadBuffByCustCtcLstIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCustCtcLstIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCustCtcLstIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCustCtcLstIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCustCtcLstIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCustCtcLstIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (CustContactListTenantId != null) {
            stmtReadBuffByCustCtcLstIdx.setLong(argIdx++, CustContactListTenantId.longValue());
        } else {
            stmtReadBuffByCustCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (CustContactListId != null) {
            stmtReadBuffByCustCtcLstIdx.setLong(argIdx++, CustContactListId.longValue());
        } else {
            stmtReadBuffByCustCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        resultSet = stmtReadBuffByCustCtcLstIdx.executeQuery();
        List<CFAccAccountConfigBuff> buffList = new LinkedList<CFAccAccountConfigBuff>();
        if (resultSet != null) {
            while (resultSet.next()) {
                CFAccAccountConfigBuff buff = unpackAccountConfigResultSetToBuff(resultSet);
                buffList.add(buff);
            }
        }
        int idx = 0;
        CFAccAccountConfigBuff[] retBuff = new CFAccAccountConfigBuff[buffList.size()];
        Iterator<CFAccAccountConfigBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMySql.CFAccMySqlAccountConfigTable.java

public CFAccAccountConfigBuff[] readBuffByCustCtcLstIdx(CFAccAuthorization Authorization,
        Long CustContactListTenantId, Long CustContactListId) {
    final String S_ProcName = "readBuffByCustCtcLstIdx";
    ResultSet resultSet = null;//  ww w. j  av a  2  s .c  om
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerSchemaDbName()
                + ".sp_read_acct_cfg_by_custctclstidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )";
        if (stmtReadBuffByCustCtcLstIdx == null) {
            stmtReadBuffByCustCtcLstIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadBuffByCustCtcLstIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCustCtcLstIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByCustCtcLstIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByCustCtcLstIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByCustCtcLstIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (CustContactListTenantId != null) {
            stmtReadBuffByCustCtcLstIdx.setLong(argIdx++, CustContactListTenantId.longValue());
        } else {
            stmtReadBuffByCustCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (CustContactListId != null) {
            stmtReadBuffByCustCtcLstIdx.setLong(argIdx++, CustContactListId.longValue());
        } else {
            stmtReadBuffByCustCtcLstIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        try {
            resultSet = stmtReadBuffByCustCtcLstIdx.executeQuery();
        } catch (SQLException e) {
            if (e.getErrorCode() != 1329) {
                throw e;
            }
            resultSet = null;
        }
        List<CFAccAccountConfigBuff> buffList = new LinkedList<CFAccAccountConfigBuff>();
        while ((resultSet != null) && resultSet.next()) {
            CFAccAccountConfigBuff buff = unpackAccountConfigResultSetToBuff(resultSet);
            buffList.add(buff);
        }
        int idx = 0;
        CFAccAccountConfigBuff[] retBuff = new CFAccAccountConfigBuff[buffList.size()];
        Iterator<CFAccAccountConfigBuff> 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;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccPgSql.CFAccPgSqlAccountTable.java

public void updateAccount(CFAccAuthorization Authorization, CFAccAccountBuff Buff) {
    final String S_ProcName = "updateAccount";
    ResultSet resultSet = null;/*from  w  w  w .java2 s . co m*/
    try {
        long TenantId = Buff.getRequiredTenantId();
        long Id = Buff.getRequiredId();
        String AccountCode = Buff.getRequiredAccountCode();
        String Description = Buff.getRequiredDescription();
        short CurrencyId = Buff.getRequiredCurrencyId();
        BigDecimal Balance = Buff.getRequiredBalance();
        Long RollupTenantId = Buff.getOptionalRollupTenantId();
        Long RollupAccountId = Buff.getOptionalRollupAccountId();
        int Revision = Buff.getRequiredRevision();
        Connection cnx = schema.getCnx();
        String sql = "select * from " + schema.getLowerSchemaDbName() + ".sp_update_acct( ?, ?, ?, ?, ?, ?"
                + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?" + ", " + "?"
                + ", " + "?" + ", " + "?" + " )";
        if (stmtUpdateByPKey == null) {
            stmtUpdateByPKey = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtUpdateByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtUpdateByPKey.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtUpdateByPKey.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtUpdateByPKey.setString(argIdx++, "ACCT");
        stmtUpdateByPKey.setLong(argIdx++, TenantId);
        stmtUpdateByPKey.setLong(argIdx++, Id);
        stmtUpdateByPKey.setString(argIdx++, AccountCode);
        stmtUpdateByPKey.setString(argIdx++, Description);
        stmtUpdateByPKey.setShort(argIdx++, CurrencyId);
        stmtUpdateByPKey.setBigDecimal(argIdx++, Balance);
        if (RollupTenantId != null) {
            stmtUpdateByPKey.setLong(argIdx++, RollupTenantId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        if (RollupAccountId != null) {
            stmtUpdateByPKey.setLong(argIdx++, RollupAccountId.longValue());
        } else {
            stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtUpdateByPKey.setInt(argIdx++, Revision);
        resultSet = stmtUpdateByPKey.executeQuery();
        if (resultSet.next()) {
            CFAccAccountBuff updatedBuff = unpackAccountResultSetToBuff(resultSet);
            if (resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect multi-record response");
            }
            Buff.setRequiredAccountCode(updatedBuff.getRequiredAccountCode());
            Buff.setRequiredDescription(updatedBuff.getRequiredDescription());
            Buff.setRequiredCurrencyId(updatedBuff.getRequiredCurrencyId());
            Buff.setRequiredBalance(updatedBuff.getRequiredBalance());
            Buff.setOptionalRollupTenantId(updatedBuff.getOptionalRollupTenantId());
            Buff.setOptionalRollupAccountId(updatedBuff.getOptionalRollupAccountId());
            Buff.setRequiredRevision(updatedBuff.getRequiredRevision());
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Expected a single-record response, " + resultSet.getRow() + " rows selected");
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMySql.CFEnSyntaxMySqlEnHeadTable.java

public void deleteEnHeadByUNameIdx(CFEnSyntaxAuthorization Authorization, Long argScopeId, String argName) {
    final String S_ProcName = "deleteEnHeadByUNameIdx";
    ResultSet resultSet = null;//from  w w w.  j a  v a 2s . c om
    try {
        Connection cnx = schema.getCnx();
        String sql = "call " + schema.getLowerDbSchemaName() + ".sp_delete_enhead_by_unameidx( ?, ?, ?, ?, ?"
                + ", " + "?" + ", " + "?" + " )";
        if (stmtDeleteByUNameIdx == null) {
            stmtDeleteByUNameIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByUNameIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtDeleteByUNameIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtDeleteByUNameIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
        if (argScopeId != null) {
            stmtDeleteByUNameIdx.setLong(argIdx++, argScopeId.longValue());
        } else {
            stmtDeleteByUNameIdx.setNull(argIdx++, java.sql.Types.BIGINT);
        }
        stmtDeleteByUNameIdx.setString(argIdx++, argName);
        stmtDeleteByUNameIdx.executeUpdate();
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
}