Example usage for java.sql CallableStatement close

List of usage examples for java.sql CallableStatement close

Introduction

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

Prototype

void close() throws SQLException;

Source Link

Document

Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.

Usage

From source file:net.sourceforge.msscodefactory.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 {//from ww w.ja v a  2s . 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;
        }
    }
}

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  a  v a  2  s.co 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;
        }
    }
}

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

public void deleteISOCurrency(CFAstAuthorization Authorization, CFAstISOCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//  w  w w  .  ja  v  a2 s. c  o  m
        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.cffreeswitch.v2_1.CFFswOracle.CFFswOracleISOCurrencyTable.java

public void deleteISOCurrency(CFFswAuthorization Authorization, CFFswISOCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//from  w w w.  j  a  v a 2s  .  co  m
        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.cfensyntax.v2_2.CFEnSyntaxOracle.CFEnSyntaxOracleISOCurrencyTable.java

public void deleteISOCurrency(CFEnSyntaxAuthorization Authorization, CFEnSyntaxISOCurrencyBuff Buff) {
    final String S_ProcName = "deleteISOCurrency";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/* w  w  w  . j av  a 2 s  .c  om*/
        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_1.CFAstOracle.CFAstOracleSecDeviceTable.java

public void deleteSecDevice(CFAstAuthorization Authorization, CFAstSecDeviceBuff Buff) {
    final String S_ProcName = "deleteSecDevice";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//  w  w  w  .  jav  a2  s  .c  o  m
        UUID SecUserId = Buff.getRequiredSecUserId();
        String DevName = Buff.getRequiredDevName();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_secdev( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setString(argIdx++, SecUserId.toString());
        stmtDeleteByPKey.setString(argIdx++, DevName);
        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.CFFswOracleSecDeviceTable.java

public void deleteSecDevice(CFFswAuthorization Authorization, CFFswSecDeviceBuff Buff) {
    final String S_ProcName = "deleteSecDevice";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {/*w ww.  j  a va2 s  .  co  m*/
        UUID SecUserId = Buff.getRequiredSecUserId();
        String DevName = Buff.getRequiredDevName();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_secdev( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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.setString(argIdx++, SecUserId.toString());
        stmtDeleteByPKey.setString(argIdx++, DevName);
        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 {//  www.j  a  va  2 s.  co  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.cffreeswitch.v2_1.CFFswOracle.CFFswOracleFSSofiaTable.java

public void deleteFSSofia(CFFswAuthorization Authorization, CFFswFSSofiaBuff Buff) {
    final String S_ProcName = "deleteFSSofia";
    Connection cnx = schema.getCnx();
    CallableStatement stmtDeleteByPKey = null;
    try {//from  w  w  w. j  a v a  2  s . c  o  m
        long TenantId = Buff.getRequiredTenantId();
        long FSSofiaId = Buff.getRequiredFSSofiaId();
        stmtDeleteByPKey = cnx.prepareCall("begin " + schema.getLowerDbSchemaName()
                + ".dl_fssofia( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " ); 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++, FSSofiaId);
        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:cn.gov.scciq.timer.acceptOrder.FRMDao.java

/**
 * ?CIQ?//  w  ww.ja  va 2  s  .c om
 * @return
 */
public static int saveCIQGoodsInfo(CEMSGoodsDataDto goodsDto) {
    int retCode = -1;
    Connection conn = null;
    CallableStatement proc = null;
    String call = "{call Pro_SaveCIQGoodsInfo(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}";
    try {
        conn = DBPool.ds.getConnection();
        proc = conn.prepareCall(call);
        proc.setString(1, goodsDto.getDecl_No());
        proc.setString(2, goodsDto.getGoods_No());
        proc.setString(3, goodsDto.getHS_Code());
        proc.setString(4, goodsDto.getGoods_CName());
        proc.setString(5, goodsDto.getGoods_EName());
        proc.setString(6, goodsDto.getGoods_Model());
        proc.setString(7, goodsDto.getOrigin_Place_Code());
        proc.setString(8, goodsDto.getOrigin_Country_Code());
        proc.setString(9, goodsDto.getWeight());
        proc.setString(10, goodsDto.getWeight_Unit_Code());
        proc.setString(11, goodsDto.getSTD_Weight());
        proc.setString(12, goodsDto.getSTD_Weight_Unit_Code());
        proc.setString(13, goodsDto.getQTY());
        proc.setString(14, goodsDto.getQTY_Unit_Code());
        proc.setString(15, goodsDto.getSTD_QTY());
        proc.setString(16, goodsDto.getSTD_QTY_Unit_Code());
        proc.setString(17, goodsDto.getPack_Number());
        proc.setString(18, goodsDto.getPack_Type_Code());
        proc.setString(19, goodsDto.getCCY());
        proc.setString(20, goodsDto.getRate());
        proc.setString(21, goodsDto.getPrice());
        proc.setString(22, goodsDto.getGoods_Values());
        proc.setString(23, goodsDto.getValues_USD());
        proc.setString(24, goodsDto.getValues_RMB());
        proc.setString(25, goodsDto.getCIQ_CODE());
        proc.setString(26, goodsDto.getINSP_MODE_CODE());
        proc.setString(27, goodsDto.getCONDITION_FLAG());
        proc.setString(28, goodsDto.getWASTE_FLAG());
        proc.setString(29, goodsDto.getCHECKUP_TYPE_CODE());
        proc.setString(30, goodsDto.getCHECKUP_WORK_CODE());
        proc.setString(31, goodsDto.getSITUATION_CODE());
        proc.setString(32, goodsDto.getSITUATION_LEVEL());
        proc.setString(33, goodsDto.getPURPOSE_CODE());
        proc.setString(34, goodsDto.getNOTIFY_NOS());
        proc.setString(35, goodsDto.getPROD_NO());
        proc.setString(36, goodsDto.getCOMBBATCH_NO());
        proc.registerOutParameter(37, Types.INTEGER);
        proc.execute();
        retCode = proc.getInt(37);
    } catch (SQLException e) {
        // TODO Auto-generated catch block
        log.error("N30", e);
    } catch (Exception e) {
        log.error("N31", e);
    } finally {
        try {
            if (proc != null) {
                proc.close();
            }
            if (conn != null) {
                conn.close();
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            log.error("N32", e);
        }
    }
    return retCode;
}