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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String[]
getColumnNames(java.sql.ResultSet rs)
Returns the column names from the ResultSet.java.lang.String[]
getColumnValues(java.sql.ResultSet rs)
Returns the column values from the result set.java.lang.String[]
getColumnValues(java.sql.ResultSet rs, boolean trim)
Returns the column values from the result set with the values trimmed if desired.java.lang.String[]
getColumnValues(java.sql.ResultSet rs, boolean trim, java.lang.String dateFormatString, java.lang.String timeFormatString)
Returns the column values from the result set with the values trimmed if desired.
-
-
-
Method Detail
-
getColumnNames
java.lang.String[] getColumnNames(java.sql.ResultSet rs) throws java.sql.SQLException
Returns the column names from the ResultSet.- Parameters:
rs
- ResultSet- Returns:
- String array containing the column names.
- Throws:
java.sql.SQLException
- Thrown by the ResultSet.
-
getColumnValues
java.lang.String[] getColumnValues(java.sql.ResultSet rs) throws java.sql.SQLException, java.io.IOException
Returns the column values from the result set.- Parameters:
rs
- The ResultSet containing the values.- Returns:
- String array containing the values.
- Throws:
java.sql.SQLException
- Thrown by the ResultSet.java.io.IOException
- Thrown by the ResultSet.
-
getColumnValues
java.lang.String[] getColumnValues(java.sql.ResultSet rs, boolean trim) throws java.sql.SQLException, java.io.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:
java.sql.SQLException
- Thrown by the ResultSet.java.io.IOException
- Thrown by the ResultSet.
-
getColumnValues
java.lang.String[] getColumnValues(java.sql.ResultSet rs, boolean trim, java.lang.String dateFormatString, java.lang.String timeFormatString) throws java.sql.SQLException, java.io.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:
java.sql.SQLException
- Thrown by the ResultSet.java.io.IOException
- Thrown by the ResultSet.
-
-