Package com.opencsv

Interface ResultSetHelper

All Known Implementing Classes:
ResultSetColumnNameHelperService, ResultSetHelperService

public interface ResultSetHelper
Interface for the ResultSetHelperService. Allows the user to define their own ResultSetHelper for use in the CSVWriter.
  • Method Details

    • getColumnNames

      String[] getColumnNames(ResultSet rs) throws SQLException
      Returns the column names from the ResultSet.
      Parameters:
      rs - ResultSet
      Returns:
      String array containing the column names.
      Throws:
      SQLException - Thrown by the ResultSet.
    • getColumnValues

      String[] getColumnValues(ResultSet rs) throws SQLException, IOException
      Returns the column values from the result set.
      Parameters:
      rs - The ResultSet containing the values.
      Returns:
      String array containing the values.
      Throws:
      SQLException - Thrown by the ResultSet.
      IOException - Thrown by the ResultSet.
    • getColumnValues

      String[] getColumnValues(ResultSet rs, boolean trim) throws SQLException, IOException
      Returns the column values from the result set with the values trimmed if desired.
      Parameters:
      rs - The ResultSet containing the values.
      trim - Values should have white spaces trimmed.
      Returns:
      String array containing the values.
      Throws:
      SQLException - Thrown by the ResultSet.
      IOException - Thrown by the ResultSet.
    • getColumnValues

      String[] getColumnValues(ResultSet rs, boolean trim, String dateFormatString, String timeFormatString) throws SQLException, IOException
      Returns the column values from the result set with the values trimmed if desired. Also format the date and time columns based on the format strings passed in.
      Parameters:
      rs - The ResultSet containing the values.
      trim - Values should have white spaces trimmed.
      dateFormatString - Format string for dates.
      timeFormatString - Format string for timestamps.
      Returns:
      String array containing the values.
      Throws:
      SQLException - Thrown by the ResultSet.
      IOException - Thrown by the ResultSet.