null, even if the database returns no
+ * {@link ResultSet}
* @throws DataAccessException if something went wrong executing the query
*/
@Support
@PlainSQL
Cursor+ * The returned {@link Stream} holds a reference to the executed + * {@link PreparedStatement} and the associated {@link ResultSet}. Data can + * be fetched (or iterated over) lazily, fetching records from the + * {@link ResultSet} one by one. + *
+ * Example (Postgres): + *
+ * Example
+ * (SQLite):
+ *
+ * String sql = "FETCH ALL IN \"
+ *
+ *
+ * String sql = "pragma table_info('my_table')";
+ * NOTE: When inserting plain SQL into jOOQ objects, you must
+ * guarantee syntax integrity. You may also create the possibility of
+ * malicious SQL injection. Be sure to properly use bind variables and/or
+ * escape literals when concatenated into SQL clauses!
+ *
+ * @param sql The SQL
+ * @return The results from the executed query. This is never
+ *
+ * There must be as many bind variables contained in the SQL, as passed in
+ * the bindings parameter
+ *
+ * The returned {@link Stream} holds a reference to the executed
+ * {@link PreparedStatement} and the associated {@link ResultSet}. Data can
+ * be fetched (or iterated over) lazily, fetching records from the
+ * {@link ResultSet} one by one.
+ *
+ * Example (Postgres):
+ *
+ *
+ *
+ * NOTE: When inserting plain SQL into jOOQ objects, you must
+ * guarantee syntax integrity. You may also create the possibility of
+ * malicious SQL injection. Be sure to properly use bind variables and/or
+ * escape literals when concatenated into SQL clauses!
+ *
+ * @param sql The SQL
+ * @param bindings The bindings
+ * @return The results from the executed query. This is never
+ *
+ * The returned {@link Stream} holds a reference to the executed
+ * {@link PreparedStatement} and the associated {@link ResultSet}. Data can
+ * be fetched (or iterated over) lazily, fetching records from the
+ * {@link ResultSet} one by one.
+ *
+ * Unlike {@link #stream(String, Object...)}, the SQL passed to this
+ * method should not contain any bind variables. Instead, you can pass
+ * {@link QueryPart} objects to the method which will be rendered at indexed
+ * locations of your SQL string as such:
+ * NOTE: When inserting plain SQL into jOOQ objects, you must
+ * guarantee syntax integrity. You may also create the possibility of
+ * malicious SQL injection. Be sure to properly use bind variables and/or
+ * escape literals when concatenated into SQL clauses! One way to escape
+ * literals is to use {@link DSL#name(String...)} and similar methods
+ *
+ * @param sql The SQL clause, containing {numbered placeholders} where query
+ * parts can be injected
+ * @param parts The {@link QueryPart} objects that are rendered at the
+ * {numbered placeholder} locations
+ * @return The results from the executed query. This is never
+ *
+ * Use {@link #fetch(ResultSet)}, to load the entire
+ * Use {@link #fetch(ResultSet)}, to load the entire
+ * The additional
+ * Use {@link #fetch(ResultSet)}, to load the entire
+ * The additional
+ * Use {@link #fetch(ResultSet)}, to load the entire
+ * The additional
@@ -6425,6 +6605,19 @@ public interface DSLContext extends Scope {
*/
+ * The result and its contained records are attached to this
+ * {@link Configuration} by default. Use {@link Settings#isAttachRecords()}
+ * to override this behaviour.
+ *
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+
+ * The result and its contained records are attached to this
+ * {@link Configuration} by default. Use {@link Settings#isAttachRecords()}
+ * to override this behaviour.
+ *
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+
diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractResultQuery.java b/jOOQ/src/main/java/org/jooq/impl/AbstractResultQuery.java
index b92b9d0ae3..9813f8dde6 100644
--- a/jOOQ/src/main/java/org/jooq/impl/AbstractResultQuery.java
+++ b/jOOQ/src/main/java/org/jooq/impl/AbstractResultQuery.java
@@ -60,13 +60,10 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
-import java.util.Spliterator;
-import java.util.Spliterators;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
import org.jooq.Configuration;
import org.jooq.Converter;
@@ -317,16 +314,7 @@ abstract class AbstractResultQuerynull, even if the database returns no
+ * {@link ResultSet}
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+ @PlainSQL
+ Stream Example
+ * (SQLite):
+ *
+ * String sql = "FETCH ALL IN \"
+ *
+ * String sql = "pragma table_info('my_table')";null, even if the database returns no
+ * {@link ResultSet}
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+ @PlainSQL
+ Stream
+ *
+ * // The following query
+ * fetchLazy("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
+ *
+ * // Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
+ * select ?, 'test' from "DUAL"
+ * null, even if the database returns no
+ * {@link ResultSet}
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+ @PlainSQL
+ StreamResultSet
+ * into a jOOQ Result at once.
+ *
+ * @param rs The JDBC ResultSet to fetch data from
+ * @return The resulting stream
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+ StreamResultSet
+ * into a jOOQ Result at once.
+ * fields argument is used by jOOQ to coerce
+ * field names and data types to the desired output
+ *
+ * @param rs The JDBC ResultSet to fetch data from
+ * @param fields The fields to use in the desired output
+ * @return The resulting stream
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+ StreamResultSet
+ * into a jOOQ Result at once.
+ * types argument is used by jOOQ to coerce data
+ * types to the desired output
+ *
+ * @param rs The JDBC ResultSet to fetch data from
+ * @param types The data types to use in the desired output
+ * @return The resulting stream
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+ StreamResultSet
+ * into a jOOQ Result at once.
+ * types argument is used by jOOQ to coerce data
+ * types to the desired output
+ *
+ * @param rs The JDBC ResultSet to fetch data from
+ * @param types The data types to use in the desired output
+ * @return The resulting stream
+ * @throws DataAccessException if something went wrong executing the query
+ */
+ @Support
+ StreamDSLContext and return
+ * a stream.
+ *
+ * @param query The query to execute
+ * @return The stream
+ * @throws DataAccessException if something went wrong executing the query
+ * @see ResultQuery#stream()
+ */
+ DSLContext and return
* a cursor.
@@ -6755,6 +6948,34 @@ public interface DSLContext extends Scope {
@Support
.
+ * SELECT * FROM [table]
.
+ * SELECT * FROM [table] WHERE [condition]