Package com.google.cloud.spanner.jdbc

# Interface CloudSpannerJdbcStatement

All Superinterfaces:
  `AutoCloseable`, `Statement`, `Wrapper`

public interface CloudSpannerJdbcStatement extends Statement
This interface is implemented by `Statement`s that are created on Cloud Spanner JDBC connections.

## Field Summary

### Fields inherited from interface java.sql.Statement

`CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO`

## Method Summary

Modifier and Type
Method
Description
`ResultSet`
`partitionQuery(String query, com.google.cloud.spanner.PartitionOptions partitionOptions, com.google.cloud.spanner.Options.QueryOption... options)`
Partitions the given query, so it can be executed in parallel.
`ResultSet`
`runPartition(String encodedPartitionId)`
Executes the given partition of a query.
`CloudSpannerJdbcPartitionedQueryResultSet`
`runPartitionedQuery(String query, com.google.cloud.spanner.PartitionOptions partitionOptions, com.google.cloud.spanner.Options.QueryOption... options)`
Executes the given query as a partitioned query.

### Methods inherited from interface java.sql.Statement

`addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

## Method Details

### partitionQuery

ResultSet partitionQuery(String query, com.google.cloud.spanner.PartitionOptions partitionOptions, com.google.cloud.spanner.Options.QueryOption... options) throws SQLException
Partitions the given query, so it can be executed in parallel. This method returns a `ResultSet` with a string-representation of the partitions that were created. These strings can be used to execute a partition either on this connection or an any other connection (on this host or an any other host) by calling the method `runPartition(String)`. This method will automatically enable data boost for the query if `CloudSpannerJdbcConnection.isDataBoostEnabled()` returns true.

Throws:
  `SQLException`

### runPartition

ResultSet runPartition(String encodedPartitionId) throws SQLException
Executes the given partition of a query. The encodedPartitionId should be a string that was returned by `partitionQuery(String, PartitionOptions, QueryOption...)`.

Throws:
  `SQLException`

### runPartitionedQuery

CloudSpannerJdbcPartitionedQueryResultSet runPartitionedQuery(String query, com.google.cloud.spanner.PartitionOptions partitionOptions, com.google.cloud.spanner.Options.QueryOption... options) throws SQLException
Executes the given query as a partitioned query. The query will first be partitioned using the `partitionQuery(String, PartitionOptions, QueryOption...)` method. Each of the partitions will then be executed in the background, and the results will be merged into a single result set.

This method will use `CloudSpannerJdbcConnection.getMaxPartitionedParallelism()` threads to execute the partitioned query. Set this variable to a higher/lower value to increase/decrease the degree of parallelism used for execution.

Throws:
  `SQLException`