org.apache.ignite.internal.jdbc2

## Class JdbcSqlFieldsQuery

- java.lang.Object
- - org.apache.ignite.cache.query.Query<List<?>>
  - - org.apache.ignite.cache.query.SqlFieldsQuery
    - - org.apache.ignite.internal.jdbc2.JdbcSqlFieldsQuery

All Implemented Interfaces:
  Serializable

    public final class JdbcSqlFieldsQuery
    extends SqlFieldsQuery

`SqlFieldsQuery` with JDBC flavor - it has additional flag indicating whether JDBC driver expects this query to return a result set or an update counter. This class is not intended for use outside JDBC driver.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.ignite.cache.query.Query

`DFLT_PAGE_SIZE`

### Method Summary

Methods
`boolean` `isQuery()`
`JdbcSqlFieldsQuery` `setArgs(Object... args)` Sets SQL arguments.
`JdbcSqlFieldsQuery` `setCollocated(boolean collocated)` Sets flag defining if this query is collocated.
`JdbcSqlFieldsQuery` `setDistributedJoins(boolean distributedJoins)` Specify if distributed joins are enabled for this query.
`JdbcSqlFieldsQuery` `setEnforceJoinOrder(boolean enforceJoinOrder)` Sets flag to enforce join order of tables in the query.
`JdbcSqlFieldsQuery` `setLocal(boolean loc)` Sets whether this query should be executed on local node only.
`JdbcSqlFieldsQuery` `setPageSize(int pageSize)` Sets optional page size, if `0`, then default is used.
`JdbcSqlFieldsQuery` `setSql(String sql)` Sets SQL clause.
`JdbcSqlFieldsQuery` `setTimeout(int timeout, TimeUnit timeUnit)` Sets the query execution timeout.

### Methods inherited from class org.apache.ignite.cache.query.SqlFieldsQuery

`getArgs, getPartitions, getSql, getTimeout, isCollocated, isDistributedJoins, isEnforceJoinOrder, isReplicatedOnly, setPartitions, setReplicatedOnly, toString`

### Methods inherited from class org.apache.ignite.cache.query.Query

`getPageSize, isLocal, prepare`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Method Detail

#### isQuery

    public boolean isQuery()

Returns:
  Flag indicating whether this object denotes a query or an update operation..

#### setSql

    public JdbcSqlFieldsQuery setSql(String sql)

Sets SQL clause.

Overrides:
  `setSql` in class `SqlFieldsQuery`
Parameters:
  `sql` - SQL clause.
Returns:
  `this` For chaining.

#### setArgs

    public JdbcSqlFieldsQuery setArgs(Object... args)

Sets SQL arguments.

Overrides:
  `setArgs` in class `SqlFieldsQuery`
Parameters:
  `args` - SQL arguments.
Returns:
  `this` For chaining.

#### setTimeout

    public JdbcSqlFieldsQuery setTimeout(int timeout,
                                TimeUnit timeUnit)

Sets the query execution timeout. Query will be automatically cancelled if the execution timeout is exceeded.

Overrides:
  `setTimeout` in class `SqlFieldsQuery`
Parameters:
  `timeout` - Timeout value. Zero value disables timeout.
  `timeUnit` - Time unit.
Returns:
  `this` For chaining.

#### setCollocated

    public JdbcSqlFieldsQuery setCollocated(boolean collocated)

Sets flag defining if this query is collocated. Collocation flag is used for optimization purposes of queries with GROUP BY statements. Whenever Ignite executes a distributed query, it sends sub-queries to individual cluster members. If you know in advance that the elements of your query selection are collocated together on the same node and you group by collocated key (primary or affinity key), then Ignite can make significant performance and network optimizations by grouping data on remote nodes.

Overrides:
  `setCollocated` in class `SqlFieldsQuery`
Parameters:
  `collocated` - Flag value.
Returns:
  `this` For chaining.

#### setEnforceJoinOrder

    public JdbcSqlFieldsQuery setEnforceJoinOrder(boolean enforceJoinOrder)

Sets flag to enforce join order of tables in the query. If set to `true` query optimizer will not reorder tables in join. By default is `false`.

It is not recommended to enable this property until you are sure that your indexes and the query itself are correct and tuned as much as possible but query optimizer still produces wrong join order.

Overrides:
  `setEnforceJoinOrder` in class `SqlFieldsQuery`
Parameters:
  `enforceJoinOrder` - Flag value.
Returns:
  `this` For chaining.

#### setDistributedJoins

    public JdbcSqlFieldsQuery setDistributedJoins(boolean distributedJoins)

Specify if distributed joins are enabled for this query.

Overrides:
  `setDistributedJoins` in class `SqlFieldsQuery`
Parameters:
  `distributedJoins` - Distributed joins enabled.
Returns:
  `this` For chaining.

#### setPageSize

    public JdbcSqlFieldsQuery setPageSize(int pageSize)

Sets optional page size, if `0`, then default is used.

Overrides:
  `setPageSize` in class `SqlFieldsQuery`
Parameters:
  `pageSize` - Optional page size.
Returns:
  `this` for chaining.

#### setLocal

    public JdbcSqlFieldsQuery setLocal(boolean loc)

Sets whether this query should be executed on local node only.

Overrides:
  `setLocal` in class `SqlFieldsQuery`
Parameters:
  `loc` - Local flag.
Returns:
  `this` for chaining.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017