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 Summary
Modifier and TypeMethodDescriptionString[]
Returns the column names from the ResultSet.String[]
Returns the column values from the result set.String[]
getColumnValues
(ResultSet rs, boolean trim) Returns the column values from the result set with the values trimmed if desired.String[]
getColumnValues
(ResultSet rs, boolean trim, String dateFormatString, String timeFormatString) Returns the column values from the result set with the values trimmed if desired.
-
Method Details
-
getColumnNames
Returns the column names from the ResultSet.- Parameters:
rs
- ResultSet- Returns:
- String array containing the column names.
- Throws:
SQLException
- Thrown by the ResultSet.
-
getColumnValues
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
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.
-