Example usage for java.sql CallableStatement setShort

List of usage examples for java.sql CallableStatement setShort

Introduction

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

Prototype

void setShort(String parameterName, short x) throws SQLException;

Source Link

Document

Sets the designated parameter to the given Java short value.

Usage

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

public void deleteISOCountry(CFFswAuthorization Authorization, CFFswISOCountryBuff Buff) {
    final String S_ProcName = "deleteISOCountry";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from w  w w .  j a  v  a2  s . c o  m*/
        short Id = Buff.getRequiredId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_cntry( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, 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.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCountryTable.java

public void deleteISOCountry(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOCountryBuff Buff) {
    final String S_ProcName = "deleteISOCountry";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from   ww w .j av  a  2  s  .c  om*/
        short Id = Buff.getRequiredId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_cntry( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, 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:com.mimp.hibernate.HiberNna.java

public void crearNna(Nna temp) {

    Session session = sessionFactory.getCurrentSession();
    session.beginTransaction();//from   www . j av  a2s .  co  m
    final Nna nna = temp;

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

            String hql = "{call HN_SAVE_NNA(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, nna.getJuzgado().getIdjuzgado());
            statement.setLong(2, nna.getCar().getIdcar());
            statement.setString(3, nna.getNombre());
            statement.setString(4, nna.getApellidoP());
            statement.setString(5, nna.getApellidoM());
            statement.setString(6, nna.getSexo());
            statement.setDate(7, (java.sql.Date) nna.getFechaNacimiento());
            statement.setShort(8, nna.getEdadAnhos());
            statement.setShort(9, nna.getEdadMeses());
            statement.setShort(10, nna.getActaNacimiento());
            statement.setString(11, nna.getCondicionSalud());
            statement.setString(12, nna.getDepartamentoNacimiento());
            statement.setString(13, nna.getProvinciaNacimiento());
            statement.setString(14, nna.getDistritoNacimiento());
            statement.setString(15, nna.getPaisNacimiento());
            statement.setString(16, nna.getLugarNac());
            statement.setDate(17, (java.sql.Date) nna.getFechaResolAbandono());
            statement.setDate(18, (java.sql.Date) nna.getFechaResolConsentida());
            statement.setString(19, nna.getClasificacion());
            statement.setShort(20, nna.getIncesto());
            statement.setShort(21, nna.getMental());
            statement.setShort(22, nna.getEpilepsia());
            statement.setShort(23, nna.getAbuso());
            statement.setShort(24, nna.getSifilis());
            statement.setShort(25, nna.getSeguiMedico());
            statement.setShort(26, nna.getOperacion());
            statement.setShort(27, nna.getHiperactivo());
            statement.setShort(28, nna.getEspecial());
            statement.setShort(29, nna.getEnfermo());
            statement.setShort(30, nna.getMayor());
            statement.setShort(31, nna.getAdolescente());
            statement.setShort(32, nna.getHermano());
            statement.setShort(33, nna.getNn());
            statement.setString(34, nna.getObservaciones());
            statement.setString(35, nna.getNResolAband());
            statement.setString(36, nna.getNResolCons());

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

From source file:com.mimp.hibernate.HiberNna.java

public void updateNna(Nna temp) {

    Session session = sessionFactory.getCurrentSession();
    session.beginTransaction();/*w ww . j  a v a  2s  . c  o m*/
    final Nna nna = temp;

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

            String hql = "{call HN_UPDATE_NNA(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, nna.getJuzgado().getIdjuzgado());
            statement.setLong(2, nna.getCar().getIdcar());
            statement.setString(3, nna.getNombre());
            statement.setString(4, nna.getApellidoP());
            statement.setString(5, nna.getApellidoM());
            statement.setString(6, nna.getSexo());
            statement.setDate(7, (java.sql.Date) nna.getFechaNacimiento());
            statement.setShort(8, nna.getEdadAnhos());
            statement.setShort(9, nna.getEdadMeses());
            statement.setShort(10, nna.getActaNacimiento());
            statement.setString(11, nna.getCondicionSalud());
            statement.setString(12, nna.getDepartamentoNacimiento());
            statement.setString(13, nna.getProvinciaNacimiento());
            statement.setString(14, nna.getDistritoNacimiento());
            statement.setString(15, nna.getPaisNacimiento());
            statement.setString(16, nna.getLugarNac());
            statement.setDate(17, (java.sql.Date) nna.getFechaResolAbandono());
            statement.setDate(18, (java.sql.Date) nna.getFechaResolConsentida());
            statement.setString(19, nna.getClasificacion());
            statement.setShort(20, nna.getIncesto());
            statement.setShort(21, nna.getMental());
            statement.setShort(22, nna.getEpilepsia());
            statement.setShort(23, nna.getAbuso());
            statement.setShort(24, nna.getSifilis());
            statement.setShort(25, nna.getSeguiMedico());
            statement.setShort(26, nna.getOperacion());
            statement.setShort(27, nna.getHiperactivo());
            statement.setShort(28, nna.getEspecial());
            statement.setShort(29, nna.getEnfermo());
            statement.setShort(30, nna.getMayor());
            statement.setShort(31, nna.getAdolescente());
            statement.setShort(32, nna.getHermano());
            statement.setShort(33, nna.getNn());
            statement.setString(34, nna.getObservaciones());
            statement.setString(35, nna.getNResolAband());
            statement.setString(36, nna.getNResolCons());
            statement.setLong(37, nna.getIdnna());

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

From source file:com.mimp.hibernate.HiberNna.java

public void crearExpNna(ExpedienteNna temp) {

    Session session = sessionFactory.getCurrentSession();
    session.beginTransaction();/*www. ja  v  a2 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_NNA(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, expnna.getNna().getIdnna());
            statement.setLong(2, expnna.getUnidad().getIdunidad());
            statement.setString(3, expnna.getNumero());
            statement.setDate(4, (java.sql.Date) expnna.getFechaIngreso());
            statement.setString(5, expnna.getHt());
            statement.setString(6, expnna.getNExpTutelar());
            statement.setString(7, expnna.getProcTutelar());
            statement.setShort(8, expnna.getFichaIntegral());
            statement.setString(9, expnna.getComentarios());
            statement.setString(10, expnna.getRespLegalNombre());
            statement.setString(11, expnna.getRespLegalP());
            statement.setString(12, expnna.getRespLegalM());
            statement.setString(13, expnna.getRespPsicosocialNombre());
            statement.setString(14, expnna.getRespPiscosocialP());
            statement.setString(15, expnna.getRespPsicosocialM());
            statement.setString(16, expnna.getEstado());
            statement.setDate(17, (java.sql.Date) expnna.getFechaEstado());
            statement.setShort(18, expnna.getAdoptable());
            statement.setDate(19, (java.sql.Date) expnna.getFechaResolCons());
            statement.setShort(20, expnna.getNacional());
            statement.setString(21, expnna.getDiagnostico());
            statement.setString(22, expnna.getCodigoReferencia());
            statement.setString(23, expnna.getNActual());
            statement.setString(24, expnna.getApellidopActual());
            statement.setString(25, expnna.getApellidomActual());
            statement.setString(26, expnna.getObservaciones());
            statement.setDate(27, (java.sql.Date) expnna.getFechaInvTutelar());
            statement.setDate(28, (java.sql.Date) expnna.getFechaIngPrio());
            statement.setDate(29, (java.sql.Date) expnna.getFechaActualizacion());

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

From source file:com.mimp.hibernate.HiberNna.java

public void updateExpNna(ExpedienteNna temp) {

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

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

            String hql = "{call HN_UPDATE_EXP_NNA(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
            CallableStatement statement = connection.prepareCall(hql);
            statement.setLong(1, expnna.getNna().getIdnna());
            statement.setLong(2, expnna.getUnidad().getIdunidad());
            statement.setString(3, expnna.getNumero());
            statement.setDate(4, (java.sql.Date) expnna.getFechaIngreso());
            statement.setString(5, expnna.getHt());
            statement.setString(6, expnna.getNExpTutelar());
            statement.setString(7, expnna.getProcTutelar());
            statement.setShort(8, expnna.getFichaIntegral());
            statement.setString(9, expnna.getComentarios());
            statement.setString(10, expnna.getRespLegalNombre());
            statement.setString(11, expnna.getRespLegalP());
            statement.setString(12, expnna.getRespLegalM());
            statement.setString(13, expnna.getRespPsicosocialNombre());
            statement.setString(14, expnna.getRespPiscosocialP());
            statement.setString(15, expnna.getRespPsicosocialM());
            statement.setString(16, expnna.getEstado());
            statement.setDate(17, (java.sql.Date) expnna.getFechaEstado());
            statement.setShort(18, expnna.getAdoptable());
            statement.setDate(19, (java.sql.Date) expnna.getFechaResolCons());
            statement.setShort(20, expnna.getNacional());
            statement.setString(21, expnna.getDiagnostico());
            statement.setString(22, expnna.getCodigoReferencia());
            statement.setString(23, expnna.getNActual());
            statement.setString(24, expnna.getApellidopActual());
            statement.setString(25, expnna.getApellidomActual());
            statement.setString(26, expnna.getObservaciones());
            statement.setDate(27, (java.sql.Date) expnna.getFechaInvTutelar());
            statement.setLong(28, expnna.getIdexpedienteNna());
            statement.setDate(29, (java.sql.Date) expnna.getFechaIngPrio());
            statement.setDate(30, (java.sql.Date) expnna.getFechaActualizacion());

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

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

public void deleteISOCurrency(CFSecurityAuthorization Authorization, CFSecurityISOCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*from ww  w.j  a v a2 s  .  com*/
        short Id = Buff.getRequiredId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_iso_ccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, 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.CFAsteriskOracleURLProtocolTable.java

public void deleteURLProtocol(CFSecurityAuthorization Authorization, CFInternetURLProtocolBuff Buff) {
    final String S_ProcName = "deleteURLProtocol";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*w  w w  .jav a 2s  .  c  o m*/
        short URLProtocolId = Buff.getRequiredURLProtocolId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_urlproto( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, URLProtocolId);
        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.CFAccOracleISOCurrencyTable.java

public void deleteISOCurrency(CFAccAuthorization Authorization, CFAccISOCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*ww w . j  a v a  2  s .c om*/
        short Id = Buff.getRequiredId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".dl_iso_ccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, 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_0.CFAstOracle.CFAstOracleISOCurrencyTable.java

public void deleteISOCurrency(CFAstAuthorization Authorization, CFAstISOCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*  ww w. j  av a2 s  .  c  o  m*/
        short Id = Buff.getRequiredId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerSchemaDbName()
                + ".dl_iso_ccy( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ); 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++, 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;
        }
    }
}