Package org.httprpc.sql
Class ResultSetAdapter
- java.lang.Object
-
- org.httprpc.sql.ResultSetAdapter
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>>
public class ResultSetAdapter extends java.lang.Object implements java.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>>, java.lang.AutoCloseableIterableadapter for JDBC result sets.
-
-
Constructor Summary
Constructors Constructor Description ResultSetAdapter(java.sql.ResultSet resultSet)Constructs a new result set adapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intgetFetchSize()Returns the result set's fetch size.java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>>iterator()java.util.Map<java.lang.String,java.lang.Object>next()Returns the next result.voidsetFetchSize(int fetchSize)Sets the result set's fetch size.java.util.stream.Stream<java.util.Map<java.lang.String,java.lang.Object>>stream()Returns a stream over the results.
-
-
-
Method Detail
-
getFetchSize
public int getFetchSize() throws java.sql.SQLExceptionReturns the result set's fetch size.- Returns:
- The result set's fetch size.
- Throws:
java.sql.SQLException- If an error occurs while retrieving the fetch size.
-
setFetchSize
public void setFetchSize(int fetchSize) throws java.sql.SQLExceptionSets the result set's fetch size.- Parameters:
fetchSize- The result set's fetch size.- Throws:
java.sql.SQLException- If an error occurs while setting the fetch size.
-
next
public java.util.Map<java.lang.String,java.lang.Object> next()
Returns the next result.- Returns:
- The next result, or
nullif there are no more results.
-
iterator
public java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>>
-
close
public void close() throws java.sql.SQLException- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.sql.SQLException
-
stream
public java.util.stream.Stream<java.util.Map<java.lang.String,java.lang.Object>> stream()
Returns a stream over the results. Closing the returned stream does not close the underlying result set.- Returns:
- A stream over the results.
-
-