Interface IDfQuery
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDeprecated, Use DF_APPLY.static final intDeprecated, Use DF_CACHE_QUERY.static final intRepresents the APPLY query type.static final intRepresents the CACHE QUERY query type.static final intRepresents the EXECUTE QUERY query type.static final intRepresents the EXECUTE READ QUERY query type.static final intUsed internally by DFC.static final intUsed internally by DFC.static final intUsed internally by DFC.static final intUsed internally by DFC.static final intRepresents the QUERY query type.static final intRepresents the READQUERY query type.static final intDeprecated, Use DF_EXEC_QUERY.static final intDeprecated, Use DF_EXECREAD_QUERY.static final intDeprecated, Use DF_QUERY.static final intDeprecated, Use DF_READ_QUERY.
- 
Method SummaryModifier and TypeMethodDescriptionexecute(IDfSession session, int queryType) Executes a DQL query.intReturns the maximum number of rows that can be returned to the server in each call to the underlying RDBMS.Returns how often the query results will be checked for consistency with the server when persistent caching is selected in the query type of execute().getDQL()Specifies the DQL statement assigned to a query.voidsetBatchSize(int batchSize) Assigns the maximum number of rows that can be returned to the server in each call to the underlying RDBMS.voidsetCurrencyCheckValue(String currencyCheckValue) Specifies how often the query results needs to checked for consistency with the server when persistent caching is selected in the query type of execute().voidAssigns a DQL statement to a query.voidsetFlushBatchOnQuery(boolean flushBatch) Specifies whether this query will cause the opening insert batch to flush.
- 
Field Details- 
DF_READ_QUERYstatic final int DF_READ_QUERYRepresents the READQUERY query type.Use this query type for queries containing SELECT statements that will not make changes to a repository during processing. You can also execute non-SELECT statements with a READ QUERY query, but there are no performance benefits in doing so. Note that if a READ QUERY query makes changes to a repository during processing, the collection returned by the query closes automatically. When the collection is closed up to batch_hint_size objects will be modified but no error or exception will be raised. Consequently, if you want a query to make changes to a repository during processing, use a QUERY query. Refer to the Server Fundamentals for more information about query processing. - See Also:
 
- 
READ_QUERYstatic final int READ_QUERYDeprecated, Use DF_READ_QUERY.- See Also:
 
- 
DF_QUERYstatic final int DF_QUERYRepresents the QUERY query type.Use this query type for queries containing any DQL statement. However, you must use this query type for queries containing SELECT statements that make changes to a repository during processing. Refer to the Server Fundamentals for more information about query processing. - See Also:
 
- 
QUERYstatic final int QUERYDeprecated, Use DF_QUERY.- See Also:
 
- 
DF_CACHE_QUERYstatic final int DF_CACHE_QUERYRepresents the CACHE QUERY query type.This query type indicates that a query executes as read-only and stores the results in a query cache file. Use this query type when you are executing a query whose results are generally static. For example, you might use a CACHEQUERY query to return the names of users in a repository. Note that for queries without a SELECT statement, you should use the EXEC QUERY, READ QUERY, or QUERY query type. Refer to the Server Fundamentals for more information about query processing. - See Also:
 
- 
CACHE_QUERYstatic final int CACHE_QUERYDeprecated, Use DF_CACHE_QUERY.- See Also:
 
- 
DF_EXEC_QUERYstatic final int DF_EXEC_QUERYRepresents the EXECUTE QUERY query type.This is same as DF_QUERY. Refer to the Server Fundamentals for more information about query processing. - See Also:
 
- 
EXEC_QUERYstatic final int EXEC_QUERYDeprecated, Use DF_EXEC_QUERY.- See Also:
 
- 
DF_EXECREAD_QUERYstatic final int DF_EXECREAD_QUERYRepresents the EXECUTE READ QUERY query type.This is same as DF_READ_QUERY. Refer to the Server Fundamentals for more information about query processing. - See Also:
 
- 
EXECREAD_QUERYstatic final int EXECREAD_QUERYDeprecated, Use DF_EXECREAD_QUERY.- See Also:
 
- 
DF_APPLYstatic final int DF_APPLYRepresents the APPLY query type.Use this query type for queries that invoke procedures that perform system administration functions or run external procedures. - See Also:
 
- 
APPLYstatic final int APPLYDeprecated, Use DF_APPLY.- See Also:
 
- 
DF_GETEVENTSstatic final int DF_GETEVENTSUsed internally by DFC.- See Also:
 
- 
DF_GETLASTCOLLstatic final int DF_GETLASTCOLLUsed internally by DFC.- See Also:
 
- 
DF_GETCONTENTstatic final int DF_GETCONTENTUsed internally by DFC.- See Also:
 
- 
DF_INTERNAL_READ_QUERYstatic final int DF_INTERNAL_READ_QUERYUsed internally by DFC.- See Also:
 
 
- 
- 
Method Details- 
executeExecutes a DQL query.Before calling this method, assign a DQL statement to the query with the setDQLmethod. Refer to the Server DQL Reference Manual for more information about DQL statements.The following code example demonstrates how to obtain an IDfQuery interface, set a DQL query to the object, execute the query, then spin through the result set: IDfQuery q = new DfQuery(); q.setDQL("select * from dm_cabinet"); IDfCollection col = q.execute(sess, DfQuery.DF_READ_QUERY); while (col.next()) { // Spin through the attributes... for (int i = 0; i < col.getAttrCount(); i++) { IDfAttr attr = col.getAttr(i); System.out.print("Attribute Name: " + attr.getName()); } } col.close();- Parameters:
- session- the current session
- queryType- the type of query that you want to execute; The following list specifies the integer corresponding to all query types:- Integer Query Type 0 READ QUERY 1 QUERY 2 CACHE QUERY 3 EXECUTE QUERY 4 EXECUTE READ QUERY 5 APPLY 
- Returns:
- an IDfCollection interface to the query results.
- Throws:
- DfException- if the query fails to execute or if the specified session has timed out and cannot be re-established.
- See Also:
 
- 
setDQLAssigns a DQL statement to a query.Queries are written with the Document Query Language (DQL). Refer to the Server DQL Reference Manual for more information about DQL statements. - Parameters:
- dqlStatement- the DQL statement
 
- 
getDQLString getDQL()Specifies the DQL statement assigned to a query.Queries are written with DQL, Document Query Language. Refer to the Server DQL Reference Manual for more information about DQL statements. - Returns:
- the query's DQL statement
 
- 
setBatchSizevoid setBatchSize(int batchSize) Assigns the maximum number of rows that can be returned to the server in each call to the underlying RDBMS.Usage Notes Each query that you make to a repository effectively queries the underlying RDBMS. If you know that the information returned from the RDBMS for each row is relatively small, use setBatchSizeto set a higher maximum number of rows returned for each call to the RDBMS. This will reduce the number of calls to the RDBMS needed to complete a query, which provides better query performance. This method allows you to optimize the performance of queries in remote client sessions. A remote client session is a DFC session in which the DFC and DMCL reside in separate processes. Refer to the Application Developer's Customization Guide for more information about remote and local client sessions.- Parameters:
- batchSize- the maximum number of rows that can be returned to the server in each call to the underlying RDBMS;
 
- 
getBatchSizeint getBatchSize()Returns the maximum number of rows that can be returned to the server in each call to the underlying RDBMS.Usage Notes Each query that you make to a repository effectively queries the underlying RDBMS. If you know that the information returned from the RDBMS for each row is relatively small, use setBatchSizeto set a higher maximum number of rows returned for each call to the RDBMS. This will reduce the number of calls to the RDBMS needed to complete a query, which provides better query performance. This method allows you to optimize the performance of queries in remote client sessions. A remote client session is a DFC session in which the DFC and DMCL reside in separate processes. Refer to the Application Developer's Customization Guide for more information about remote and local client sessions.- Returns:
- the maximum number of rows that can be returned to the server in each call to the underlying RDBMS
 
- 
getCurrencyCheckValueString getCurrencyCheckValue()Returns how often the query results will be checked for consistency with the server when persistent caching is selected in the query type of execute().- Returns:
- If the value is numeric it indicates the time (in seconds) which the caller is willing to allow the query to be used without being rechecked for consistency. If the requested query is found in the cache and has not been checked for consistency in the specified time period then it is checked and re-issued from the server if necessary. If the value is non-numeric then it specifies a cache configuration object which defines the consistency check rules.
 
- 
setCurrencyCheckValueSpecifies how often the query results needs to checked for consistency with the server when persistent caching is selected in the query type of execute().- Parameters:
- currencyCheckValue- specifies that the query should be persistently cached and indicates how often the query needs to checked for consistency with the server. If the value is numeric it indicates the time (in seconds) which the caller is willing to allow the query to be used without being rechecked for consistency. If the requested query is found in the cache and has not been checked for consistency in the specified time period then it is checked and re-issued from the server if necessary. If the value is non-numeric then it specifies a cache configuration object which defines the consistency check rules. Specify- nullif you don't want the query persistently cached.
 
- 
setFlushBatchOnQueryvoid setFlushBatchOnQuery(boolean flushBatch) Specifies whether this query will cause the opening insert batch to flush. Since the batch will cache the insert data, the batch has to flush the data so that the query can return the changes made in the batch. If not set, the query will use the flag set in IDfBatchManager. If the flag is true, server will flush the data whenever there is a query on the type/table that is in batch. If the caller knows that the query is not on data in the batch, setting the flag to false can avoid unnecessary batch flushes.Notes The batch is the insert batch, not the query batch. - Parameters:
- flushBatch- boolean- true, flush the batch when the query is on a batched table (default),- false, do not flush the batch
 
 
-