Package org.apache.juneau.dto
Class ResultSetList
java.lang.Object
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Map<String,
,Object>> Collection<Map<String,
,Object>> Deque<Map<String,
,Object>> List<Map<String,
,Object>> Queue<Map<String,
Object>>
Transforms an SQL
ResultSet
into a list of maps.
Loads the entire result set into an in-memory data structure, and then closes the result set object.
See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionResultSetList
(ResultSet rs, int pos, int limit, boolean includeRowNums) Constructor. -
Method Summary
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
Methods inherited from class java.util.AbstractSequentialList
iterator
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Constructor Details
-
ResultSetList
Constructor.- Parameters:
rs
- The result set to load into this DTO.pos
- The start position (zero-indexed).limit
- The maximum number of rows to retrieve.includeRowNums
- Make the first column be the row number.- Throws:
SQLException
- Database error.
-
-
Method Details
-
readEntry
Reads the specified column from the current row in the result set.Subclasses can override this method to handle specific data types in special ways.
- Parameters:
rs
- The result set to read from.col
- The column number (indexed by 1).dataType
- Thetype
of the entry.- Returns:
- The entry as an Object.
-