Package com.clickhouse.jdbc

## Interface ClickHouseConnection

All Superinterfaces:
  `AutoCloseable`, `Connection`, `Wrapper`

All Known Implementing Classes:
  `ClickHouseConnectionImpl`

    public interface ClickHouseConnection
    extends Connection

### Field Summary

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

`TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE`

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`default ClickHouseStatement` `createStatement()`
`default ClickHouseStatement` `createStatement​(int resultSetType, int resultSetConcurrency)`
`ClickHouseStatement` `createStatement​(int resultSetType, int resultSetConcurrency, int resultSetHoldability)`
`String` `getCurrentDatabase()` Gets current database.
`String` `getCurrentUser()` Gets current user.
`Calendar` `getDefaultCalendar()` Gets default calendar which can be used to create timestamp.
`Optional<TimeZone>` `getEffectiveTimeZone()` Gets effective time zone.
`TimeZone` `getJvmTimeZone()` Gets cached value of `TimeZone.getDefault()`.
`TimeZone` `getServerTimeZone()` Gets server time zone, which is either same as result of `select timezone()`, or the overrided value from `ClickHouseConfig.getServerTimeZone()`.
`ClickHouseVersion` `getServerVersion()`
`URI` `getUri()`
`boolean` `isJdbcCompliant()`
`String` `newQueryId()`
`default CallableStatement` `prepareCall​(String sql)`
`default CallableStatement` `prepareCall​(String sql, int resultSetType, int resultSetConcurrency)`
`default CallableStatement` `prepareCall​(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)`
`default PreparedStatement` `prepareStatement​(String sql)`
`default PreparedStatement` `prepareStatement​(String sql, int autoGeneratedKeys)`
`default PreparedStatement` `prepareStatement​(String sql, int[] columnIndexes)`
`default PreparedStatement` `prepareStatement​(String sql, int resultSetType, int resultSetConcurrency)`
`default PreparedStatement` `prepareStatement​(String sql, String[] columnNames)`

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

`abort, beginRequest, clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, endRequest, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid, setTransactionIsolation, setTypeMap`

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

`isWrapperFor, unwrap`

### Method Detail

#### createStatement

    default ClickHouseStatement createStatement()
                                         throws SQLException

Specified by:
  `createStatement` in interface `Connection`
Throws:
  `SQLException`

#### createStatement

    default ClickHouseStatement createStatement​(int resultSetType,
                                                int resultSetConcurrency)
                                         throws SQLException

Specified by:
  `createStatement` in interface `Connection`
Throws:
  `SQLException`

#### createStatement

    ClickHouseStatement createStatement​(int resultSetType,
                                        int resultSetConcurrency,
                                        int resultSetHoldability)
                                 throws SQLException

Specified by:
  `createStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareCall

    default CallableStatement prepareCall​(String sql)
                                   throws SQLException

Specified by:
  `prepareCall` in interface `Connection`
Throws:
  `SQLException`

#### prepareCall

    default CallableStatement prepareCall​(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency)
                                   throws SQLException

Specified by:
  `prepareCall` in interface `Connection`
Throws:
  `SQLException`

#### prepareCall

    default CallableStatement prepareCall​(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws SQLException

Specified by:
  `prepareCall` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    default PreparedStatement prepareStatement​(String sql)
                                        throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    default PreparedStatement prepareStatement​(String sql,
                                               int autoGeneratedKeys)
                                        throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    default PreparedStatement prepareStatement​(String sql,
                                               int[] columnIndexes)
                                        throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    default PreparedStatement prepareStatement​(String sql,
                                               String[] columnNames)
                                        throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### prepareStatement

    default PreparedStatement prepareStatement​(String sql,
                                               int resultSetType,
                                               int resultSetConcurrency)
                                        throws SQLException

Specified by:
  `prepareStatement` in interface `Connection`
Throws:
  `SQLException`

#### getCurrentDatabase

    String getCurrentDatabase()

Gets current database. `Connection.getSchema()` is similar but it will check if connection is closed or not hence may throw `SQLException`.

Returns:
  non-null database name

#### getCurrentUser

    String getCurrentUser()

Gets current user.

Returns:
  non-null user name

#### getDefaultCalendar

    Calendar getDefaultCalendar()

Gets default calendar which can be used to create timestamp.

Returns:
  non-null calendar

#### getEffectiveTimeZone

    Optional<TimeZone> getEffectiveTimeZone()

Gets effective time zone. When `ClickHouseConfig.isUseServerTimeZone()` returns `true`, `ClickHouseConfig.getUseTimeZone()` will be used as effective time zone, which will be used for reading and writing timestamp values.

Returns:
  effective time zone

#### getJvmTimeZone

    TimeZone getJvmTimeZone()

Gets cached value of `TimeZone.getDefault()`.

Returns:
  non-null cached JVM time zone

#### getServerTimeZone

    TimeZone getServerTimeZone()

Gets server time zone, which is either same as result of `select timezone()`, or the overrided value from `ClickHouseConfig.getServerTimeZone()`.

Returns:
  non-null server time zone

#### getServerVersion

    ClickHouseVersion getServerVersion()

#### getUri

    URI getUri()

#### isJdbcCompliant

    boolean isJdbcCompliant()

#### newQueryId

    String newQueryId()