public class ResultSetHelperService extends Object implements ResultSetHelper
Modifier and Type | Field and Description |
---|---|
static int |
CLOBBUFFERSIZE |
Constructor and Description |
---|
ResultSetHelperService()
Default 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.
|
protected String |
handleBigDecimal(BigDecimal decimal)
changes a BigDecimal to String.
|
protected String |
handleDate(ResultSet rs,
int columnIndex,
String dateFormatString)
Retrieves a date from the result set.
|
protected String |
handleInteger(ResultSet rs,
int columnIndex)
Retrieves the string representation of an Integer value from the result set.
|
protected String |
handleLong(ResultSet rs,
int columnIndex)
Retrieves the string representation of an Long value from the result set.
|
protected String |
handleObject(Object obj)
changes an object to a String.
|
protected String |
handleTime(Time time)
Return time read from ResultSet.
|
protected String |
handleTimestamp(Timestamp timestamp,
String timestampFormatString)
The formatted timestamp.
|
public static final int CLOBBUFFERSIZE
public String[] getColumnNames(ResultSet rs) throws SQLException
getColumnNames
in interface ResultSetHelper
rs
- - ResultSetSQLException
- - thrown by the result set.public String[] getColumnValues(ResultSet rs) throws SQLException, IOException
getColumnValues
in interface ResultSetHelper
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
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
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.protected String handleObject(Object obj)
obj
- - Object to format.protected String handleBigDecimal(BigDecimal decimal)
decimal
- - BigDecimal to formatprotected String handleLong(ResultSet rs, int columnIndex) throws SQLException
rs
- - Result set containing the data.columnIndex
- - index to the column of the long.SQLException
- - thrown by the result set on error.protected String handleInteger(ResultSet rs, int columnIndex) throws SQLException
rs
- - Result set containing the data.columnIndex
- - index to the column of the integer.SQLException
- - returned from the result set on error.protected String handleDate(ResultSet rs, int columnIndex, String dateFormatString) throws SQLException
rs
- - Result set containing the datacolumnIndex
- - index to the column of the datedateFormatString
- - format for the dateSQLException
- - returned from the result set on error.protected String handleTime(Time time)
time
- time read from ResultSetCopyright © 2015. All rights reserved.