nl.topicus.jdbc

## Class CloudSpannerConnectionPoolDataSource

- java.lang.Object
- - nl.topicus.jdbc.metadata.AbstractCloudSpannerWrapper
  - - nl.topicus.jdbc.CloudSpannerDataSource
    - - nl.topicus.jdbc.CloudSpannerConnectionPoolDataSource

All Implemented Interfaces:
  Serializable, Wrapper, CommonDataSource, ConnectionPoolDataSource, DataSource

    public class CloudSpannerConnectionPoolDataSource
    extends CloudSpannerDataSource
    implements ConnectionPoolDataSource, Serializable

Implementation of the ConnectionPoolDataSource interface. This implementation is based on the implementation of PostgreSQL. PostgreSQL is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses. PostgreSQL Database Management System (formerly known as Postgres, then as Postgres95) Portions Copyright (c) 1996-2017, The PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

Author:
  loite
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`CloudSpannerConnectionPoolDataSource()`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getDescription()`
`Logger` `getParentLogger()`
`CloudSpannerPooledConnection` `getPooledConnection()` Gets a connection which may be pooled by the app server or middleware implementation of DataSource.
`CloudSpannerPooledConnection` `getPooledConnection(String user, String password)` Gets a connection which may be pooled by the app server or middleware implementation of DataSource.
`boolean` `isDefaultAutoCommit()` Gets whether connections supplied by this pool will have autoCommit turned on by default.
`void` `setDefaultAutoCommit(boolean defaultAutoCommit)` Sets whether connections supplied by this pool will have autoCommit turned on by default.

### Methods inherited from class nl.topicus.jdbc.CloudSpannerDataSource

`getConnection, getConnection, getDatabase, getHost, getInstanceId, getLoginTimeout, getLogWriter, getOauthAccessToken, getProjectId, getPvtKeyPath, getSimulateProductName, getUrl, isAllowExtendedMode, isUseCustomHost, setAllowExtendedMode, setDatabase, setHost, setInstanceId, setLoginTimeout, setLogWriter, setOauthAccessToken, setProjectId, setPvtKeyPath, setSimulateProductName, setUrl, setUseCustomHost`

### Methods inherited from class nl.topicus.jdbc.metadata.AbstractCloudSpannerWrapper

`extractColumnType, getClassName, getClassName, getGoogleTypeName, isWrapperFor, unwrap`

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

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

### Methods inherited from interface javax.sql.CommonDataSource

`getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter`

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

`isWrapperFor, unwrap`

### Constructor Detail

#### CloudSpannerConnectionPoolDataSource

    public CloudSpannerConnectionPoolDataSource()

### Method Detail

#### getDescription

    public String getDescription()

Returns:
  A description of this data source

#### getPooledConnection

    public CloudSpannerPooledConnection getPooledConnection()
                                                     throws SQLException

Gets a connection which may be pooled by the app server or middleware implementation of DataSource.

Specified by:
  `getPooledConnection` in interface `ConnectionPoolDataSource`
Throws:
  `SQLException` - Occurs when the physical database connection cannot be established.

#### getPooledConnection

    public CloudSpannerPooledConnection getPooledConnection(String user,
                                                            String password)
                                                     throws SQLException

Gets a connection which may be pooled by the app server or middleware implementation of DataSource.

Specified by:
  `getPooledConnection` in interface `ConnectionPoolDataSource`
Throws:
  `SQLException` - Occurs when the physical database connection cannot be established.

#### isDefaultAutoCommit

    public boolean isDefaultAutoCommit()

Gets whether connections supplied by this pool will have autoCommit turned on by default. The default value is `false`, so that autoCommit will be turned off by default.

Returns:
  true if connections supplied by this pool will have autoCommit

#### setDefaultAutoCommit

    public void setDefaultAutoCommit(boolean defaultAutoCommit)

Sets whether connections supplied by this pool will have autoCommit turned on by default. The default value is `false`, so that autoCommit will be turned off by default.

Parameters:
  `defaultAutoCommit` - whether connections supplied by this pool will have autoCommit

#### getParentLogger

    public Logger getParentLogger()
                           throws SQLFeatureNotSupportedException

Specified by:
  `getParentLogger` in interface `CommonDataSource`
Overrides:
  `getParentLogger` in class `CloudSpannerDataSource`
Throws:
  `SQLFeatureNotSupportedException`