Example usage for java.sql CallableStatement setLong

List of usage examples for java.sql CallableStatement setLong

Introduction

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

Prototype

void setLong(String parameterName, long x) throws SQLException;

Source Link

Document

Sets the designated parameter to the given Java long value.

Usage

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

public void deleteISOCountryCurrency(CFAstAuthorization Authorization, CFAstISOCountryCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCountryCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//w  w  w .  j  a v a 2 s .  co  m
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOCurrencyId = Buff.getRequiredISOCurrencyId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".dl_iso_cntryccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setShort(argIdx++, ISOCountryId);
        stmtDeleteByPKey.setShort(argIdx++, ISOCurrencyId);
        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.CFAstOracleISOCountryLanguageTable.java

public void deleteISOCountryLanguage(CFAstAuthorization Authorization, CFAstISOCountryLanguageBuff Buff) {
    final String S_ProcName = "deleteISOCountryLanguage";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from ww w .  java 2 s . c  o m*/
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOLanguageId = Buff.getRequiredISOLanguageId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".dl_iso_cntrylng( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setShort(argIdx++, ISOCountryId);
        stmtDeleteByPKey.setShort(argIdx++, ISOLanguageId);
        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.CFAstOracleISOCountryCurrencyTable.java

public void deleteISOCountryCurrency(CFAstAuthorization Authorization, CFAstISOCountryCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCountryCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//from   w w  w.  j a  v  a 2  s .c o m
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOCurrencyId = Buff.getRequiredISOCurrencyId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_cntryccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setShort(argIdx++, ISOCountryId);
        stmtDeleteByPKey.setShort(argIdx++, ISOCurrencyId);
        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.CFAstOracleISOCountryLanguageTable.java

public void deleteISOCountryLanguage(CFAstAuthorization Authorization, CFAstISOCountryLanguageBuff Buff) {
    final String S_ProcName = "deleteISOCountryLanguage";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//from w w w .j  a va 2s  . c  om
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOLanguageId = Buff.getRequiredISOLanguageId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_cntrylng( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setShort(argIdx++, ISOCountryId);
        stmtDeleteByPKey.setShort(argIdx++, ISOLanguageId);
        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.CFAstSybase.CFAstSybaseTenantTable.java

public int nextTSecGroupIdGen(CFAstAuthorization Authorization, CFAstTenantPKey PKey) {
    final String S_ProcName = "nextTSecGroupIdGen";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Not in a transaction");
    }/*from   w  w w. j a va 2 s.co  m*/
    Connection cnx = schema.getCnx();
    long Id = PKey.getRequiredId();

    CallableStatement stmtSelectNextTSecGroupIdGen = null;
    try {
        String sql = "{ call sp_next_tsecgroupidgen( ?" + ", " + "?" + " ) }";
        stmtSelectNextTSecGroupIdGen = cnx.prepareCall(sql);
        int argIdx = 1;
        stmtSelectNextTSecGroupIdGen.registerOutParameter(argIdx++, java.sql.Types.INTEGER);
        stmtSelectNextTSecGroupIdGen.setLong(argIdx++, Id);
        stmtSelectNextTSecGroupIdGen.execute();
        int nextId = stmtSelectNextTSecGroupIdGen.getInt(1);
        return (nextId);
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (stmtSelectNextTSecGroupIdGen != null) {
            try {
                stmtSelectNextTSecGroupIdGen.close();
            } catch (SQLException e) {
            }
            stmtSelectNextTSecGroupIdGen = null;
        }
    }
}

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

public void deleteISOCountryCurrency(CFFswAuthorization Authorization, CFFswISOCountryCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCountryCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//  w w  w .  j av  a  2  s . co m
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOCurrencyId = Buff.getRequiredISOCurrencyId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_cntryccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setShort(argIdx++, ISOCountryId);
        stmtDeleteByPKey.setShort(argIdx++, ISOCurrencyId);
        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.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOCountryLanguageTable.java

public void deleteISOCountryLanguage(CFFswAuthorization Authorization, CFFswISOCountryLanguageBuff Buff) {
    final String S_ProcName = "deleteISOCountryLanguage";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from w  w  w  . j a v a2  s  .  c o  m*/
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOLanguageId = Buff.getRequiredISOLanguageId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_cntrylng( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setShort(argIdx++, ISOCountryId);
        stmtDeleteByPKey.setShort(argIdx++, ISOLanguageId);
        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:com.mimp.hibernate.HiberNna.java

public void crearExpNna2(ExpedienteNna temp) {

    Session session = sessionFactory.getCurrentSession();
    session.beginTransaction();//from  w  w w.ja v a  2 s .c o  m
    final ExpedienteNna expnna = temp;

    Work work = new Work() {
        @Override
        public void execute(Connection connection) throws SQLException {

            String hql = "{call HN_SAVE_EXP_NNA2(?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, expnna.getNna().getIdnna());
            statement.setLong(2, expnna.getUnidad().getIdunidad());
            statement.setString(3, expnna.getNumero());

            statement.execute();
            statement.close();
        }
    };
    session.doWork(work);
}

From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCountryCurrencyTable.java

public void deleteISOCountryCurrency(CFEnSyntaxAuthorization Authorization,
        CFEnSyntaxISOCountryCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCountryCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from  ww  w. ja  va 2  s. c o m*/
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOCurrencyId = Buff.getRequiredISOCurrencyId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_cntryccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setShort(argIdx++, ISOCountryId);
        stmtDeleteByPKey.setShort(argIdx++, ISOCurrencyId);
        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.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCountryLanguageTable.java

public void deleteISOCountryLanguage(CFEnSyntaxAuthorization Authorization,
        CFEnSyntaxISOCountryLanguageBuff Buff) {
    final String S_ProcName = "deleteISOCountryLanguage";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from w  ww.  j  a  v  a 2  s. c o  m*/
        short ISOCountryId = Buff.getRequiredISOCountryId();
        short ISOLanguageId = Buff.getRequiredISOLanguageId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_cntrylng( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setShort(argIdx++, ISOCountryId);
        stmtDeleteByPKey.setShort(argIdx++, ISOLanguageId);
        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;
        }
    }
}