Java Utililty Methods SQL ResultSet Read

List of utility methods to do SQL ResultSet Read

Description

The list of methods to do SQL ResultSet Read are organized into topic(s).

Method

List>readResults(ResultSet resultSet)
read Results
String[] columns = getColumns(resultSet);
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
while (resultSet.next()) {
    Map<String, Object> current = new LinkedHashMap<String, Object>();
    for (int i = 0; i < columns.length; i++) {
        Object data = resultSet.getObject(columns[i]);
        if (data != null) {
            current.put(columns[i].toLowerCase(), resultSet.getObject(columns[i]));
...
TwasNull(ResultSet rs, T value)
was Null
return rs.wasNull() ? null : value;
TwasNull(ResultSet rs, T value)
Convenient way to check if a JDBC-originated record was null.
return rs.wasNull() ? null : value;
TwasNull(ResultSet rs, T value)
Convenient way to check if a JDBC-originated record was null.
return (value == null || rs.wasNull()) ? null : value;