Interface Statement.StatementBuilder

Enclosing interface:
Statement

public static interface Statement.StatementBuilder
Statement builder provides methods for building a statement object, which represents a query and holds query-specific settings that overrides the query execution context defaults.
  • Method Details

    • query

      Sets an SQL statement string.
      Parameters:
      query - SQL query.
      Returns:
      this for chaining.
    • queryTimeout

      Statement.StatementBuilder queryTimeout(long timeout, TimeUnit timeUnit)
      Sets a query timeout.
      Parameters:
      timeout - Query timeout value. Must be positive.
      timeUnit - Timeunit.
      Returns:
      this for chaining.
    • defaultSchema

      Statement.StatementBuilder defaultSchema(String schema)
      Sets a default schema for the statement.
      Parameters:
      schema - Default schema.
      Returns:
      this for chaining.
    • pageSize

      Statement.StatementBuilder pageSize(int pageSize)
      Sets a page size - the maximum number of result rows that can be fetched at a time.
      Parameters:
      pageSize - Maximum number of rows per page. Must be positive.
      Returns:
      this for chaining.
    • timeZoneId

      Statement.StatementBuilder timeZoneId(ZoneId timeZoneId)
      Sets a time zone for this statement.

      This time zone is used in the following cases:

      1. When using SQL functions to obtain the current time (for example SELECT CURRENT_TIME)
      2. When converting a string literal to/from a TIMESTAMP WITH LOCAL TIME ZONE column (for example SELECT TIMESTAMP WITH LOCAL TIME ZONE '1992-01-18 02:30:00.123'

      If the time zone has not been set explicitly, the current JVM default time zone will be used.

      Parameters:
      timeZoneId - Time-zone ID.
      Returns:
      this for chaining.
    • build

      Statement build()
      Creates an SQL statement abject.
      Returns:
      Statement.