public class ResultSetColumnNameHelperService extends ResultSetHelperService implements ResultSetHelper
CLOBBUFFERSIZE
Constructor and Description |
---|
ResultSetColumnNameHelperService()
Silence code style checker by adding a useless constructor.
|
Modifier and Type | Method and Description |
---|---|
String[] |
getColumnNames(ResultSet rs)
Returns the column names from the result set.
|
String[] |
getColumnValues(ResultSet rs)
Get all the column values from the result set.
|
String[] |
getColumnValues(ResultSet rs,
boolean trim)
Get all the column values from the result set.
|
String[] |
getColumnValues(ResultSet rs,
boolean trim,
String dateFormatString,
String timeFormatString)
Get all the column values from the result set.
|
void |
setColumnNames(String[] columnNames,
String[] columnHeaders)
Set the JDBC column names to use, and the header text for the CSV file
|
handleTimestamp, setDateFormat, setDateTimeFormat
public ResultSetColumnNameHelperService()
public void setColumnNames(String[] columnNames, String[] columnHeaders)
columnNames
- The JDBC column names to export, in the desired ordercolumnHeaders
- The column headers of the CSV file, in the desired orderUnsupportedOperationException
- If the number of headers is different
than the number of columns, or if any of the columns or headers is blank
or null.public String[] getColumnNames(ResultSet rs) throws SQLException
getColumnNames
in interface ResultSetHelper
getColumnNames
in class ResultSetHelperService
rs
- ResultSetSQLException
- Thrown by the result set.public String[] getColumnValues(ResultSet rs) throws SQLException, IOException
getColumnValues
in interface ResultSetHelper
getColumnValues
in class ResultSetHelperService
rs
- The ResultSet containing the values.SQLException
- Thrown by the result set.IOException
- Thrown by the result set.public String[] getColumnValues(ResultSet rs, boolean trim) throws SQLException, IOException
getColumnValues
in interface ResultSetHelper
getColumnValues
in class ResultSetHelperService
rs
- The ResultSet containing the values.trim
- Values should have white spaces trimmed.SQLException
- Thrown by the result set.IOException
- Thrown by the result set.public String[] getColumnValues(ResultSet rs, boolean trim, String dateFormatString, String timeFormatString) throws SQLException, IOException
getColumnValues
in interface ResultSetHelper
getColumnValues
in class ResultSetHelperService
rs
- The ResultSet containing the values.trim
- Values should have white spaces trimmed.dateFormatString
- Format string for dates.timeFormatString
- Format string for timestamps.SQLException
- Thrown by the result set.IOException
- Thrown by the result set.Copyright © 2017. All rights reserved.