Top Description Methods
com.opencsv

public Interface ResultSetHelper

Known Direct Implementers
com.opencsv.ResultSetHelperService, com.opencsv.ResultSetColumnNameHelperService
Imports
java.io.IOException, java.sql.ResultSet, .SQLException

Interface for the ResultSetHelperService. Allows the user to define their own ResultSetHelper for use in the CSVWriter.

Method Summary

Modifier and TypeMethod and Description
public String[]

Returns:

String array containing the column names.
getColumnNames
(ResultSet
ResultSet
rs
)

Returns the column names from the ResultSet.

public String[]

Returns:

String array containing the values.
getColumnValues
(ResultSet
The ResultSet containing the values.
rs
)

Returns the column values from the result set.

public String[]

Returns:

String array containing the values.
getColumnValues
(ResultSet
The ResultSet containing the values.
rs
,
boolean
Values should have white spaces trimmed.
trim
)

Returns the column values from the result set with the values trimmed if desired.

public String[]

Returns:

String array containing the values.
getColumnValues
(ResultSet
The ResultSet containing the values.
rs
,
boolean
Values should have white spaces trimmed.
trim
,
String
Format string for dates.
dateFormatString
,
String
Format string for timestamps.
timeFormatString
)

Returns the column values from the result set with the values trimmed if desired.

Method Detail

getColumnNamesback to summary
public String[] getColumnNames(ResultSet rs) throws SQLException

Returns the column names from the ResultSet.

Parameters
rs:ResultSet

ResultSet

Returns:String[]

String array containing the column names.

Exceptions
SQLException:
Thrown by the ResultSet.
getColumnValuesback to summary
public String[] getColumnValues(ResultSet rs) throws SQLException, IOException

Returns the column values from the result set.

Parameters
rs:ResultSet

The ResultSet containing the values.

Returns:String[]

String array containing the values.

Exceptions
SQLException:
Thrown by the ResultSet.
IOException:
Thrown by the ResultSet.
getColumnValuesback to summary
public 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:ResultSet

The ResultSet containing the values.

trim:boolean

Values should have white spaces trimmed.

Returns:String[]

String array containing the values.

Exceptions
SQLException:
Thrown by the ResultSet.
IOException:
Thrown by the ResultSet.
getColumnValuesback to summary
public 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:ResultSet

The ResultSet containing the values.

trim:boolean

Values should have white spaces trimmed.

dateFormatString:String

Format string for dates.

timeFormatString:String

Format string for timestamps.

Returns:String[]

String array containing the values.

Exceptions
SQLException:
Thrown by the ResultSet.
IOException:
Thrown by the ResultSet.