Example usage for java.sql ResultSet hashCode

List of usage examples for java.sql ResultSet hashCode

Introduction

In this page you can find the example usage for java.sql ResultSet hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:com.egt.core.db.util.Exporter.java

private static String export(ResultSet resultSet, String report, String target, String format, Long usuario)
        throws Exception {
    Bitacora.trace(Exporter.class, "export", report, target, format);
    String targetFileName = null;
    if (target == null) {
        targetFileName = report + "_" + System.currentTimeMillis() + "_" + resultSet.hashCode();
    } else {/*ww w  .ja v a 2 s  .  c  om*/
        targetFileName = target;
    }
    targetFileName += "." + format;
    targetFileName = targetFileName.toLowerCase();
    String outputFileName = Utils.getSpooledFilesDir(usuario) + targetFileName;
    EnumFormatoArchivo type = getExportType(format);
    switch (type) {
    case TXT:
        FileWriter txtFileWriter = new FileWriter(outputFileName);
        CSVWriter txtCSVWriter = new CSVWriter(txtFileWriter, '\t', CSVWriter.NO_QUOTE_CHARACTER,
                CSVWriter.DEFAULT_ESCAPE_CHARACTER, ',');
        txtCSVWriter.writeAll(resultSet, true);
        txtCSVWriter.close();
        break;
    //          case XML:
    //              break;
    default:
        FileWriter csvFileWriter = new FileWriter(outputFileName);
        CSVWriter csvCSVWriter = new CSVWriter(csvFileWriter, ';', '"', CSVWriter.DEFAULT_ESCAPE_CHARACTER,
                ',');
        csvCSVWriter.writeAll(resultSet, true);
        csvCSVWriter.close();
        break;
    }
    return targetFileName;
}

From source file:ips1ap101.lib.core.db.util.Exporter.java

private static String export(ResultSet resultSet, String report, String target, String format, Long usuario)
        throws Exception {
    Bitacora.trace(Exporter.class, "export", report, target, format);
    String targetFileName;//from w w w.  j  a  v  a2s  .  co  m
    if (target == null) {
        targetFileName = report + "_" + System.currentTimeMillis() + "_" + resultSet.hashCode();
    } else {
        targetFileName = target;
    }
    targetFileName += "." + format;
    targetFileName = targetFileName.toLowerCase();
    String outputFileName = Utils.getSpooledFilesDir(usuario) + targetFileName;
    EnumFormatoArchivo type = getExportType(format);
    switch (type) {
    case TXT:
        FileWriter txtFileWriter = new FileWriter(outputFileName);
        CSVWriter txtCSVWriter = new CSVWriter(txtFileWriter, '\t', CSVWriter.NO_QUOTE_CHARACTER,
                CSVWriter.DEFAULT_ESCAPE_CHARACTER, ',');
        txtCSVWriter.writeAll(resultSet, true);
        txtCSVWriter.close();
        break;
    //          case XML:
    //              break;
    default:
        FileWriter csvFileWriter = new FileWriter(outputFileName);
        CSVWriter csvCSVWriter = new CSVWriter(csvFileWriter, ';', '"', CSVWriter.DEFAULT_ESCAPE_CHARACTER,
                ',');
        csvCSVWriter.writeAll(resultSet, true);
        csvCSVWriter.close();
        break;
    }
    return Utils.getWebServerRelativePath(outputFileName);
}