Package javatapas.sql

Class WriteResultSetToFile

java.lang.Object
javatapas.sql.WriteResultSetToFile

public class WriteResultSetToFile
extends Object
Write a JDBC ResultSet to delimited text file, using a specified delimiter.

Published at https://www.javatapas.com/sql/Java-Write-Result-Set-To-File.html

Javadoc at https://www.javatapas.com/docs/javatapas/sql/WriteResultSetToFile.html
Version:
2021-05-20
Author:
Kodiak Brown
  • Constructor Details

    • WriteResultSetToFile

      public WriteResultSetToFile()
  • Method Details

    • writeResultSetToFile

      public static void writeResultSetToFile​(ResultSet rset, boolean includeFieldNames, String fileName, String delim) throws SQLException, IOException
      Parameters:
      rset - The ResultSet to write to the file.
      includeFieldNames - Boolean option if true, ResultSet field names will be written to the first line of the file.
      fileName - The name of the file to write the ResultSet to.
      delim - The delimiter to use between each column value on each line.
      Throws:
      SQLException
      IOException