Interface CloudSpannerJdbcPreparedStatement (2.25.0)

public interface CloudSpannerJdbcPreparedStatement extends PreparedStatement

This interface is implemented by PreparedStatements that are created on Cloud Spanner JDBC connections.

Implements

PreparedStatement

Methods

partitionQuery(PartitionOptions partitionOptions, Options.QueryOption[] options)

public abstract ResultSet partitionQuery(PartitionOptions partitionOptions, Options.QueryOption[] options)

Partitions this 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(). This method will automatically enable data boost for the query if CloudSpannerJdbcConnection#isDataBoostEnabled() returns true.

Parameters
Name Description
partitionOptions PartitionOptions
options QueryOption[]
Returns
Type Description
ResultSet
Exceptions
Type Description
SQLException

runPartition()

public abstract ResultSet runPartition()

Executes the given partition of a query. The partition that should be executed must be set as a string parameter on this PreparedStatement using #setString(int, String). The value should be a string that was returned by #partitionQuery(PartitionOptions, QueryOption...).

Returns
Type Description
ResultSet
Exceptions
Type Description
SQLException

runPartitionedQuery(PartitionOptions partitionOptions, Options.QueryOption[] options)

public abstract CloudSpannerJdbcPartitionedQueryResultSet runPartitionedQuery(PartitionOptions partitionOptions, Options.QueryOption[] options)

Executes the given query as a partitioned query. The query will first be partitioned using the #partitionQuery(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.

Parameters
Name Description
partitionOptions PartitionOptions
options QueryOption[]
Returns
Type Description
CloudSpannerJdbcPartitionedQueryResultSet
Exceptions
Type Description
SQLException