com.pivotal.gemfirexd.internal.client.am

## Class LogicalConnection40

- java.lang.Object
- - com.pivotal.gemfirexd.internal.client.am.LogicalConnection
  - - com.pivotal.gemfirexd.internal.client.am.LogicalConnection40

All Implemented Interfaces:
  AutoCloseable, Connection, Wrapper

Direct Known Subclasses:
  CachingLogicalConnection40

    public class LogicalConnection40
    extends LogicalConnection

A simple delegation wrapper handle for a physical connection. This class only contains JDBC 4.0 specific methods. NOTE: All non-implemented JDBC 4.0 methods are located here, but when they are implemented, they should be moved to the superclass if possible.

### Field Summary

### Fields inherited from class com.pivotal.gemfirexd.internal.client.am.LogicalConnection

`physicalConnection_`

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

`TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE`

### Constructor Summary

Constructors
Constructor and Description
`LogicalConnection40(Connection physicalConnection, ClientPooledConnection pooledConnection)`

### Method Summary

Methods
`void` `abort(Executor executor)`
`Array` `createArrayOf(String typeName, Object[] elements)`
`Blob` `createBlob()`
`Clob` `createClob()`
`NClob` `createNClob()`
`SQLXML` `createSQLXML()`
`Struct` `createStruct(String typeName, Object[] attributes)`
`Properties` `getClientInfo()` `getClientInfo` forwards to `physicalConnection_`.
`String` `getClientInfo(String name)` `getClientInfo` forwards to `physicalConnection_`.
`int` `getNetworkTimeout()`
`String` `getSchema()`
`Map<String,Class<?>>` `getTypeMap()` Returns the type map for this connection.
`boolean` `isValid(int timeout)` Checks if the connection has not been closed and is still valid.
`boolean` `isWrapperFor(Class<?> interfaces)`
`void` `setClientInfo(Properties properties)` `setClientInfo` forwards to `physicalConnection_`.
`void` `setClientInfo(String name, String value)` `setClientInfo` forwards to `physicalConnection_`.
`void` `setNetworkTimeout(Executor executor, int milliseconds)`
`void` `setSchema(String schema)`
`<T> T` `unwrap(Class<T> interfaces)`

### Methods inherited from class com.pivotal.gemfirexd.internal.client.am.LogicalConnection

`checkForNullPhysicalConnection, clearWarnings, close, closeWithoutRecyclingToPool, commit, createStatement, createStatement, createStatement, finalize, getAutoCommit, getCatalog, getHoldability, getMetaData, getServerVersion, getTransactionID, getTransactionIsolation, getWarnings, isClosed, isReadOnly, nativeSQL, nullPhysicalConnection, prepareCall, prepareCall, prepareCall, preparePositionedUpdateStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap`

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

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

### Constructor Detail

#### LogicalConnection40

    public LogicalConnection40(Connection physicalConnection,
                       ClientPooledConnection pooledConnection)
                        throws SqlException

Throws:
  `SqlException`

### Method Detail

#### createArrayOf

    public Array createArrayOf(String typeName,
                      Object[] elements)
                        throws SQLException

Throws:
  `SQLException`

#### createBlob

    public Blob createBlob()
                    throws SQLException

Throws:
  `SQLException`

#### createClob

    public Clob createClob()
                    throws SQLException

Throws:
  `SQLException`

#### createNClob

    public NClob createNClob()
                      throws SQLException

Throws:
  `SQLException`

#### createSQLXML

    public SQLXML createSQLXML()
                        throws SQLException

Throws:
  `SQLException`

#### createStruct

    public Struct createStruct(String typeName,
                      Object[] attributes)
                        throws SQLException

Throws:
  `SQLException`

#### getClientInfo

    public Properties getClientInfo()
                             throws SQLException

`getClientInfo` forwards to `physicalConnection_`. `getClientInfo` always returns an empty `Properties` object since Derby doesn't support ClientInfoProperties.

Returns:
  an empty `Properties` object
Throws:
  `SQLException` - if an error occurs

#### getClientInfo

    public String getClientInfo(String name)
                         throws SQLException

`getClientInfo` forwards to `physicalConnection_`. Always returns a `null String` since Derby does not support ClientInfoProperties.

Parameters:
  `name` - a property key to get `String`
Returns:
  a property value `String`
Throws:
  `SQLException` - if an error occurs

#### getTypeMap

    public Map<String,Class<?>> getTypeMap()
                                    throws SQLException

Returns the type map for this connection.

Specified by:
  `getTypeMap` in interface `Connection`
Overrides:
  `getTypeMap` in class `LogicalConnection`
Returns:
  type map for this connection
Throws:
  `SQLException` - if a database access error occurs

#### isValid

    public boolean isValid(int timeout)
                    throws SQLException

Checks if the connection has not been closed and is still valid. The validity is checked by running a simple query against the database.

Parameters:
  `timeout` - The time in seconds to wait for the database operation used to validate the connection to complete. If the timeout period expires before the operation completes, this method returns false. A value of 0 indicates a timeout is not applied to the database operation.
Returns:
  true if the connection is valid, false otherwise
Throws:
  `SQLException` - if the call on the physical connection throws an exception.

#### isWrapperFor

    public boolean isWrapperFor(Class<?> interfaces)
                         throws SQLException

Throws:
  `SQLException`

#### setClientInfo

    public void setClientInfo(Properties properties)
                       throws SQLClientInfoException

`setClientInfo` forwards to `physicalConnection_`.

Parameters:
  `properties` - a `Properties` object with the properties to set
Throws:
  `SQLClientInfoException` - if an error occurs

#### setClientInfo

    public void setClientInfo(String name,
                     String value)
                       throws SQLClientInfoException

`setClientInfo` forwards to `physicalConnection_`.

Parameters:
  `name` - a property key `String`
  `value` - a property value `String`
Throws:
  `SQLException` - if an error occurs
  `SQLClientInfoException`

#### unwrap

    public <T> T unwrap(Class<T> interfaces)
             throws SQLException

Throws:
  `SQLException`

#### setSchema

    public void setSchema(String schema)
                   throws SQLException

Throws:
  `SQLException`

#### getSchema

    public String getSchema()
                     throws SQLException

Throws:
  `SQLException`

#### abort

    public void abort(Executor executor)
               throws SQLException

Throws:
  `SQLException`

#### setNetworkTimeout

    public void setNetworkTimeout(Executor executor,
                         int milliseconds)
                           throws SQLException

Throws:
  `SQLException`

#### getNetworkTimeout

    public int getNetworkTimeout()
                          throws SQLException

Throws:
  `SQLException`