public final class Pql extends Object
| Modifier and Type | Method and Description |
|---|---|
static Value |
createValue(Object value)
Creates a
Value from the value i.e. |
static String[] |
getColumnLabels(ResultSet resultSet)
Gets the column labels for the result set.
|
static String[] |
getRowStringValues(Row row)
Gets the values in a row of the result set in the form of a string
array.
|
static Object[] |
getRowValues(Row row)
Gets the values in a row of the result set in the form of an object
array.
|
static String |
resultSetToString(ResultSet resultSet)
Gets the result set as a table representation in the form of:
|
static List<String[]> |
resultSetToStringArrayList(ResultSet resultSet)
Gets the result set as list of string arrays, which can be transformed to
a CSV using
CSVWriter. |
public static Value createValue(Object value)
Value from the value i.e. a TextValue for a
value of type String, BooleanValue for type
Boolean, NumberValue for type Double,
Long, or Integer, and DateTimeValue for type
DateTime. If the value is a Value, the value is returned.
If the value is null, an empty TextValue is returned.value - the value to convertIllegalArgumentException - if value cannot be convertedpublic static List<String[]> resultSetToStringArrayList(ResultSet resultSet)
CSVWriter.resultSet - the result set to convert to a CSV compatible formatpublic static String resultSetToString(ResultSet resultSet) throws IllegalAccessException
+-------+-------+-------+ |column1|column2|column3| +-------+-------+-------+ |value1 |value2 |value3 | +-------+-------+-------+ |value1 |value2 |value3 | +-------+-------+-------+
resultSet - the result set to display as a stringIllegalAccessException - if the values of the result set cannot be
accessedpublic static String[] getColumnLabels(ResultSet resultSet)
resultSet - the result set to get the column labels forpublic static Object[] getRowValues(Row row) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
row - the row to get the values forIllegalArgumentException - if the value could not be extracted from
the row valueIllegalAccessException - if the row value could not be accessedNoSuchMethodException - if the row value could not be accessedInvocationTargetException - if the row value could not be accessedpublic static String[] getRowStringValues(Row row) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
null values are interpreted as empty strings.row - the row to get the values forIllegalArgumentException - if the value could not be extracted from
the row valueIllegalAccessException - if the row value could not be accessedNoSuchMethodException - if the row value could not be accessedInvocationTargetException - if the row value could not be accessedCopyright © 2013. All Rights Reserved.