execute method (DominoQuery - Java)

Executes a query string passed in according to set parameters and returns named results in a database where they can be accessed again more quickly. For reuse of complex queries, this saves significant processing time.

Defined in

DominoQuery

Syntax

DocumentCollection execute (String query) throws NotesException

DocumentCollection execute(String query, String resultname) throws NotesException

DocumentCollection execute(String query, String resultname, boolean replace, int expirehours) throws NotesException

Parameters

String query

A string containing a DQL query.

String resultname

An optional name to use to save the DocumentCollection in a database for future DQL reference. The name is case-insensitive.

boolean replace

If a saved DocumentCollection with resultname exists, overwrite it. If not set, an error is thrown indicating a conflict.

String int expirehours

The amount of time, in hours, to retain a saved DocumentCollection for future DQL reference. Default is 24 hours if omitted.

Note: The Domino updall command used with the -j option provides options for managing named results. For more information, see the Domino documentation.

Returned value

DocumentCollection

Usage

Returns results from a DQL query. The query is performed and a DocumentCollection is returned for use in all legal contexts. Some runtime errors are also possible and if they occur, their text will appear in the NotesException that is returned.

Note: In preparation for a future refresh capability, if your query contains substitution variables (e.g. ?value1) then you cannot save the results.

Language cross-reference

Execute method (NotesDominoQuery - LotusScript)