Module org.jooq
Package org.jooq

Interface Query

    • Method Detail

      • execute

        int execute()
             throws DataAccessException
        Execute the query, if it has been created with a proper configuration.
        Returns:
        A result value, depending on the concrete implementation of Query:
        • Delete : the number of deleted records
        • Insert : the number of inserted records
        • Merge : the result may have no meaning
        • Select : the number of resulting records
        • Truncate : the result may have no meaning
        • Update : the number of updated records
        Throws:
        DataAccessException - If anything goes wrong in the database
      • executeAsync

        @NotNull
        @NotNull CompletionStage<Integer> executeAsync​(Executor executor)
        Execute the query in a new CompletionStage that is asynchronously completed by a task running in the given executor.
        Returns:
        A result value, depending on the concrete implementation of Query:
        • Delete : the number of deleted records
        • Insert : the number of inserted records
        • Merge : the result may have no meaning
        • Select : the number of resulting records
        • Truncate : the result may have no meaning
        • Update : the number of updated records
      • isExecutable

        boolean isExecutable()
        Whether this query is executable in its current state.

        DML queries may be incomplete in structure and thus not executable. Calling execute() on such queries has no effect, but beware that AttachableQueryPart.getSQL() may not render valid SQL!

      • keepStatement

        @NotNull
        @NotNull Query keepStatement​(boolean keepStatement)
        Keep the query's underlying statement open after execution.

        This indicates to jOOQ that the query's underlying Statement or PreparedStatement should be kept open after execution. If it is kept open, client code is responsible for properly closing it using close()

        Parameters:
        keepStatement - Whether to keep the underlying statement open