com.amazon.redshift.core.v3

## Class ConnectionFactoryImpl

- java.lang.Object
- - com.amazon.redshift.core.ConnectionFactory
  - - com.amazon.redshift.core.v3.ConnectionFactoryImpl

    public class ConnectionFactoryImpl
    extends ConnectionFactory

ConnectionFactory implementation for version 3 (7.4+) connections.

Author:
  Oliver Jowett (oliver@opencloud.com), based on the previous implementation

### Field Summary

Fields
`static int` `BASE_SERVER_PROTOCOL_VERSION`
`static int` `DEFAULT_SERVER_PROTOCOL_VERSION`
`static int` `EXTENDED_RESULT_METADATA_SERVER_PROTOCOL_VERSION`

### Constructor Summary

Constructors
Constructor and Description
`ConnectionFactoryImpl()`

### Method Summary

All Methods Instance Methods Concrete Methods
`QueryExecutor` `openConnectionImpl(HostSpec[] hostSpecs, String user, String database, Properties info, RedshiftLogger logger)` Implementation of `ConnectionFactory.openConnection(com.amazon.redshift.util.HostSpec[], java.lang.String, java.lang.String, java.util.Properties, com.amazon.redshift.logger.RedshiftLogger)` for a particular protocol version.

### Methods inherited from class com.amazon.redshift.core.ConnectionFactory

`closeStream, openConnection`

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

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

### Field Detail

#### BASE_SERVER_PROTOCOL_VERSION

    public static int BASE_SERVER_PROTOCOL_VERSION

#### EXTENDED_RESULT_METADATA_SERVER_PROTOCOL_VERSION

    public static int EXTENDED_RESULT_METADATA_SERVER_PROTOCOL_VERSION

#### DEFAULT_SERVER_PROTOCOL_VERSION

    public static int DEFAULT_SERVER_PROTOCOL_VERSION

### Constructor Detail

#### ConnectionFactoryImpl

    public ConnectionFactoryImpl()

### Method Detail

#### openConnectionImpl

    public QueryExecutor openConnectionImpl(HostSpec[] hostSpecs,
                                            String user,
                                            String database,
                                            Properties info,
                                            RedshiftLogger logger)
                                     throws SQLException

Description copied from class: `ConnectionFactory`
Implementation of `ConnectionFactory.openConnection(com.amazon.redshift.util.HostSpec[], java.lang.String, java.lang.String, java.util.Properties, com.amazon.redshift.logger.RedshiftLogger)` for a particular protocol version. Implemented by subclasses of `ConnectionFactory`.

Specified by:
  `openConnectionImpl` in class `ConnectionFactory`
Parameters:
  `hostSpecs` - at least one host and port to connect to; multiple elements for round-robin failover
  `user` - the username to authenticate with; may not be null.
  `database` - the database on the server to connect to; may not be null.
  `info` - extra properties controlling the connection; notably, "password" if present supplies the password to authenticate with.
  `logger` - the logger to log the entry for debugging.
Returns:
  the new, initialized, connection, or `null` if this protocol version is not supported by the server.
Throws:
  `SQLException` - if the connection could not be established for a reason other than protocol version incompatibility.