Package org.apache.commons.dbutils

## Class StatementConfiguration

- java.lang.Object
- - org.apache.commons.dbutils.StatementConfiguration

-     public class StatementConfiguration
      extends Object

  Configuration options for a `Statement` when preparing statements in `QueryRunner`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `StatementConfiguration.Builder` | Builder class for `StatementConfiguration` for more flexible construction.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StatementConfiguration​(Integer fetchDirection, Integer fetchSize, Integer maxFieldSize, Integer maxRows, Integer queryTimeout)` | Deprecated. Use `StatementConfiguration(Integer, Integer, Integer, Integer, Duration)`.
    `StatementConfiguration​(Integer fetchDirection, Integer fetchSize, Integer maxFieldSize, Integer maxRows, Duration queryTimeout)` | Constructor for `StatementConfiguration`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Integer` | `getFetchDirection()` | Get the fetch direction.
    `Integer` | `getFetchSize()` | Get the fetch size.
    `Integer` | `getMaxFieldSize()` | Get the max field size.
    `Integer` | `getMaxRows()` | Get the max rows.
    `Integer` | `getQueryTimeout()` | Deprecated. Use `getQueryTimeoutDuration()`.
    `Duration` | `getQueryTimeoutDuration()` | Get the query timeout.
    `boolean` | `isFetchDirectionSet()` | Whether fetch direction is set.
    `boolean` | `isFetchSizeSet()` | Whether fetch size is set.
    `boolean` | `isMaxFieldSizeSet()` | Whether max field size is set.
    `boolean` | `isMaxRowsSet()` | Whether max rows is set.
    `boolean` | `isQueryTimeoutSet()` | Whether query timeout is set.

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

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

- - ### Constructor Detail

    - #### StatementConfiguration

          public StatementConfiguration​(Integer fetchDirection,
                                        Integer fetchSize,
                                        Integer maxFieldSize,
                                        Integer maxRows,
                                        Duration queryTimeout)

      Constructor for `StatementConfiguration`. For more flexibility, use `StatementConfiguration.Builder`.
      Parameters:
        `fetchDirection` - The direction for fetching rows from database tables.
        `fetchSize` - The number of rows that should be fetched from the database when more rows are needed.
        `maxFieldSize` - The maximum number of bytes that can be returned for character and binary column values.
        `maxRows` - The maximum number of rows that a `ResultSet` can produce.
        `queryTimeout` - The number of seconds the driver will wait for execution.
      Since:
        1.8.0

    - #### StatementConfiguration

          @Deprecated
          public StatementConfiguration​(Integer fetchDirection,
                                        Integer fetchSize,
                                        Integer maxFieldSize,
                                        Integer maxRows,
                                        Integer queryTimeout)

      Deprecated.
      Use `StatementConfiguration(Integer, Integer, Integer, Integer, Duration)`.
      Constructor for `StatementConfiguration`. For more flexibility, use `StatementConfiguration.Builder`.
      Parameters:
        `fetchDirection` - The direction for fetching rows from database tables.
        `fetchSize` - The number of rows that should be fetched from the database when more rows are needed.
        `maxFieldSize` - The maximum number of bytes that can be returned for character and binary column values.
        `maxRows` - The maximum number of rows that a `ResultSet` can produce.
        `queryTimeout` - The number of seconds the driver will wait for execution.

  - ### Method Detail

    - #### getFetchDirection

          public Integer getFetchDirection()

      Get the fetch direction.
      Returns:
        The direction to fetch or null if not set.

    - #### getFetchSize

          public Integer getFetchSize()

      Get the fetch size.
      Returns:
        The fetch size or null if not set.

    - #### getMaxFieldSize

          public Integer getMaxFieldSize()

      Get the max field size.
      Returns:
        The max field size or null if not set.

    - #### getMaxRows

          public Integer getMaxRows()

      Get the max rows.
      Returns:
        The max rows or null if not set.

    - #### getQueryTimeout

          @Deprecated
          public Integer getQueryTimeout()

      Deprecated.
      Use `getQueryTimeoutDuration()`.
      Get the query timeout.
      Returns:
        The query timeout or null if not set.

    - #### getQueryTimeoutDuration

          public Duration getQueryTimeoutDuration()

      Get the query timeout.
      Returns:
        The query timeout or null if not set.
      Since:
        1.8.0

    - #### isFetchDirectionSet

          public boolean isFetchDirectionSet()

      Whether fetch direction is set.
      Returns:
        true if set, false otherwise.

    - #### isFetchSizeSet

          public boolean isFetchSizeSet()

      Whether fetch size is set.
      Returns:
        true if set, false otherwise.

    - #### isMaxFieldSizeSet

          public boolean isMaxFieldSizeSet()

      Whether max field size is set.
      Returns:
        true if set, false otherwise.

    - #### isMaxRowsSet

          public boolean isMaxRowsSet()

      Whether max rows is set.
      Returns:
        true if set, false otherwise.

    - #### isQueryTimeoutSet

          public boolean isQueryTimeoutSet()

      Whether query timeout is set.
      Returns:
        true if set, false otherwise.