Example usage for java.sql CallableStatement setInt

List of usage examples for java.sql CallableStatement setInt

Introduction

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

Prototype

void setInt(String parameterName, int x) throws SQLException;

Source Link

Document

Sets the designated parameter to the given Java int value.

Usage

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

public CFAstTSecGroupIncludeBuff readBuffByUIncludeIdx(CFAstAuthorization Authorization, long TenantId,
        int TSecGroupId, int IncludeGroupId) {
    final String S_ProcName = "readBuffByUIncludeIdx";
    ResultSet resultSet = null;//ww w .  jav  a  2s.  c  o m
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByUIncludeIdx = null;
    try {
        stmtReadBuffByUIncludeIdx = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".rd_tsecincbyuincludeidx( ?, ?, ?, ?, ?, ?" + ", "
                        + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByUIncludeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, TSecGroupId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, IncludeGroupId);
        stmtReadBuffByUIncludeIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByUIncludeIdx.getObject(1);
        if (resultSet == null) {
            return (null);
        }
        try {
            if (resultSet.next()) {
                CFAstTSecGroupIncludeBuff buff = unpackTSecGroupIncludeResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                return (buff);
            } else {
                return (null);
            }
        } catch (SQLException e) {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtReadBuffByUIncludeIdx != null) {
            try {
                stmtReadBuffByUIncludeIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByUIncludeIdx = null;
        }
    }
}

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

public CFAstTSecGroupIncludeBuff readBuffByUIncludeIdx(CFAstAuthorization Authorization, long TenantId,
        int TSecGroupId, int IncludeGroupId) {
    final String S_ProcName = "readBuffByUIncludeIdx";
    ResultSet resultSet = null;/*from   w  w w  .j a  v a 2  s  .  c o  m*/
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByUIncludeIdx = null;
    try {
        stmtReadBuffByUIncludeIdx = cnx.prepareCall(
                "begin " + schema.getLowerDbSchemaName() + ".rd_tsecincbyuincludeidx( ?, ?, ?, ?, ?, ?" + ", "
                        + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByUIncludeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++, TenantId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, TSecGroupId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, IncludeGroupId);
        stmtReadBuffByUIncludeIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByUIncludeIdx.getObject(1);
        if (resultSet == null) {
            return (null);
        }
        try {
            if (resultSet.next()) {
                CFAstTSecGroupIncludeBuff buff = unpackTSecGroupIncludeResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                return (buff);
            } else {
                return (null);
            }
        } catch (SQLException e) {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtReadBuffByUIncludeIdx != null) {
            try {
                stmtReadBuffByUIncludeIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByUIncludeIdx = null;
        }
    }
}

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

public CFAccSecGroupIncludeBuff readBuffByUIncludeIdx(CFAccAuthorization Authorization, long ClusterId,
        int SecGroupId, int IncludeGroupId) {
    final String S_ProcName = "readBuffByUIncludeIdx";
    ResultSet resultSet = null;//from w w w  . ja  va  2  s .  com
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByUIncludeIdx = null;
    try {
        stmtReadBuffByUIncludeIdx = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".rd_secincbyuincludeidx( ?, ?, ?, ?, ?, ?" + ", "
                        + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByUIncludeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++, ClusterId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, SecGroupId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, IncludeGroupId);
        stmtReadBuffByUIncludeIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByUIncludeIdx.getObject(1);
        if (resultSet == null) {
            return (null);
        }
        try {
            if (resultSet.next()) {
                CFAccSecGroupIncludeBuff buff = unpackSecGroupIncludeResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                return (buff);
            } else {
                return (null);
            }
        } catch (SQLException e) {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtReadBuffByUIncludeIdx != null) {
            try {
                stmtReadBuffByUIncludeIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByUIncludeIdx = null;
        }
    }
}

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

public CFAstSecGroupIncludeBuff readBuffByUIncludeIdx(CFAstAuthorization Authorization, long ClusterId,
        int SecGroupId, int IncludeGroupId) {
    final String S_ProcName = "readBuffByUIncludeIdx";
    ResultSet resultSet = null;//from   w w  w.ja va 2 s .c  o m
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByUIncludeIdx = null;
    try {
        stmtReadBuffByUIncludeIdx = cnx.prepareCall(
                "begin " + schema.getLowerSchemaDbName() + ".rd_secincbyuincludeidx( ?, ?, ?, ?, ?, ?" + ", "
                        + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByUIncludeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++, ClusterId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, SecGroupId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, IncludeGroupId);
        stmtReadBuffByUIncludeIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByUIncludeIdx.getObject(1);
        if (resultSet == null) {
            return (null);
        }
        try {
            if (resultSet.next()) {
                CFAstSecGroupIncludeBuff buff = unpackSecGroupIncludeResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                return (buff);
            } else {
                return (null);
            }
        } catch (SQLException e) {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtReadBuffByUIncludeIdx != null) {
            try {
                stmtReadBuffByUIncludeIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByUIncludeIdx = null;
        }
    }
}

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

public CFAstSecGroupIncludeBuff readBuffByUIncludeIdx(CFAstAuthorization Authorization, long ClusterId,
        int SecGroupId, int IncludeGroupId) {
    final String S_ProcName = "readBuffByUIncludeIdx";
    ResultSet resultSet = null;//from ww w  .  java2 s. co  m
    Connection cnx = schema.getCnx();
    CallableStatement stmtReadBuffByUIncludeIdx = null;
    try {
        stmtReadBuffByUIncludeIdx = cnx.prepareCall(
                "begin " + schema.getLowerDbSchemaName() + ".rd_secincbyuincludeidx( ?, ?, ?, ?, ?, ?" + ", "
                        + "?" + ", " + "?" + ", " + "?" + " ); end;");
        int argIdx = 1;
        stmtReadBuffByUIncludeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadBuffByUIncludeIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadBuffByUIncludeIdx.setLong(argIdx++, ClusterId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, SecGroupId);
        stmtReadBuffByUIncludeIdx.setInt(argIdx++, IncludeGroupId);
        stmtReadBuffByUIncludeIdx.execute();
        resultSet = (ResultSet) stmtReadBuffByUIncludeIdx.getObject(1);
        if (resultSet == null) {
            return (null);
        }
        try {
            if (resultSet.next()) {
                CFAstSecGroupIncludeBuff buff = unpackSecGroupIncludeResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
                }
                return (buff);
            } else {
                return (null);
            }
        } catch (SQLException e) {
            return (null);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
        if (stmtReadBuffByUIncludeIdx != null) {
            try {
                stmtReadBuffByUIncludeIdx.close();
            } catch (SQLException e) {
            }
            stmtReadBuffByUIncludeIdx = null;
        }
    }
}

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

public void deleteAddress(CFAccAuthorization Authorization, CFAccAddressBuff Buff) {
    final String S_ProcName = "deleteAddress";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from ww  w. j av a  2 s.  co  m*/
        long TenantId = Buff.getRequiredTenantId();
        long AddressId = Buff.getRequiredAddressId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".dl_address( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, AddressId);
        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.CFAccOracleServiceTable.java

public void deleteService(CFAccAuthorization Authorization, CFAccServiceBuff Buff) {
    final String S_ProcName = "deleteService";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from w  w w. java2 s . co  m*/
        long ClusterId = Buff.getRequiredClusterId();
        long ServiceId = Buff.getRequiredServiceId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".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;
        }
    }
}

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

public void deleteService(CFAstAuthorization Authorization, CFAstServiceBuff Buff) {
    final String S_ProcName = "deleteService";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//w  ww. j av a2s . c  o m
        long ClusterId = Buff.getRequiredClusterId();
        long ServiceId = Buff.getRequiredServiceId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".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;
        }
    }
}

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

public void deleteService(CFAstAuthorization Authorization, CFAstServiceBuff Buff) {
    final String S_ProcName = "deleteService";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//  w w  w .j  a va2 s  . co  m
        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;
        }
    }
}