Package com.ocient.jdbc

# Class XGConnection

java.lang.Object
com.ocient.jdbc.XGConnection

All Implemented Interfaces:
  `AutoCloseable`, `Connection`, `Wrapper`

public class XGConnection extends Object implements Connection

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`XGConnection.ConfirmationSupplier<Response>`
`static enum`
`XGConnection.ConnectionPoolingMode`
`static enum`
`XGConnection.ConnectionProperty`
`static enum`
`XGConnection.ConnectionPropertyGroup`
`static enum`
`XGConnection.HandshakeType`
`static class`
`XGConnection.RemoteEndpoint`
Represents an addressable endpoint for a network interface
`static class`
`XGConnection.RemoteNode`
Represents a server with multiple network interfaces
`static interface`
`XGConnection.ResponseHandler<Response>`
A response handler for wire messages.
`protected static class`
`XGConnection.Session`
`static enum`
`XGConnection.Tls`
`static class`
`XGConnection.XGConnectionFactory`
Handles the entire XGConnection lifecycle.
`static class`
`XGConnection.XGTrustManager`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`client`
`protected static final String`
`CLIENT_VERSION`
`protected String`
`connectedIp`
`protected int`
`connectedPort`
`protected String`
`database`
`static final String`
`DEFAULT_SCHEMA_VALUE`
`static final Map<String,SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>>`
`DEFAULT_TRANSPORT_FACTORIES`
`protected boolean`
`force`
`protected String`
`fullyQualifiedUsername`
`protected DurationCounter`
`handshakeDurationCounter`
`protected Optional<XGConnection.RemoteEndpoint>`
`lastConnectedEndpoint`
`Integer`
`maxRows`
`protected static boolean`
`metricsEnabled`
`protected OptionalInt`
`networkTimeout`
`static final String`
`OKTA_NATIVE_SSO_TOKEN_FILE_NAME`
`static final Path`
`OKTA_NATIVE_SSO_TOKEN_FILE_PATH`
`protected boolean`
`oneShotForce`
`protected String`
`originalIp`
`protected int`
`originalPort`
`protected CaselessProperties`
`properties`
`protected String`
`protocolVersion`
`protected String`
`pwd`
`protected XGResultSet`
`rs`
`protected List<XGConnection.RemoteNode>`
`secondaryInterfaces`
`protected String`
`serverSessionId`
`protected String`
`serverVersion`
`protected XGConnection.Session`
`session`
`static final String`
`sessionID`
`protected com.ocient.jdbc.XGConnection.Session.State`
`sessionState`
`protected Optional<String>`
`setSchema`
`protected XGConnection.Tls`
`tls`
`protected Map<String,Class<?>>`
`typeMap`
`protected final String`
`url`
`protected String`
`user`
`static final Path`
`USER_HOME_PATH`
`protected ArrayList<SQLWarning>`
`warnings`

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

`TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE`

## Method Summary

Modifier and Type
Method
Description
`void`
`abort(Executor executor)`
`protected void`
`addTimeout(TimerTask task, long timeout)`
Schedules the task to run after the specified delay
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`awaitActivation()`
`void`
`clearOneShotForce()`
`void`
`clearWarnings()`
`void`
`close()`
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`closeAsync()`
`void`
`commit()`
`void`
`connect()`
`boolean`
`connected()`
`Array`
`createArrayOf(String arg0, Object[] arg1)`
`Blob`
`createBlob()`
`Clob`
`createClob()`
`NClob`
`createNClob()`
`static OktaAuthenticators.OktaNativeSSOToken`
`createOktaNativeSSOToken(ClientWireProtocol.OpenIDAuthenticator authenticator, Properties properties)`
`SQLXML`
`createSQLXML()`
`Statement`
`createStatement()`
`Statement`
`createStatement(int arg0, int arg1)`
`Statement`
`createStatement(int arg0, int arg1, int arg2)`
`Struct`
`createStruct(String arg0, Object[] arg1)`
`protected static <Response, ResponseBuilder extends com.google.protobuf.GeneratedMessageV3.Builder<?>>
Response`
`deserializeProto(ResponseBuilder builder, io.netty.buffer.ByteBuf wireMessage)`
Deserializes a protobuf message from a ByteBuf.
`CompletionStage<CompletableFutures.SQLResult<List<ClientWireProtocol.Authenticator>>>`
`fetchAuthenticators()`
Fetches all `ClientWireProtocol.Authenticator`s
`protected CompletionStage<CompletableFutures.SQLResult<Void>>`
`fetchServerVersion()`
Asynchronously fetches the version of the server.
`void`
`forceExternal(boolean force)`
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`forceExternalAsync(boolean force)`
`XGConnection`
`forkConnection(XGConnectionInfo.Hint hint, boolean hint_bypassLoadBalancerOnHandshakeOnly)`
Forks a new XGConnection based on the current connection, with optional hints for connection type.
`CompletionStage<CompletableFutures.SQLResult<XGConnection>>`
`forkConnectionAsync(XGConnectionInfo.Hint hint, boolean hint_bypassLoadBalancerOnHandshakeOnly)`
`boolean`
`getAutoCommit()`
`String`
`getCatalog()`
`Properties`
`getClientInfo()`
`String`
`getClientInfo(String arg0)`
`static Set<Gauge>`
`getConnectionPoolGauges()`
`static HashSet<String>`
`getConnectionPropertiesSet()`
`String`
`getDB()`
`static OpenIDAuthenticators.OAuthFlow`
`getDefaultOAuthFlow()`
`Optional<Throwable>`
`getFatalException()`
`String`
`getFullyQualifiedUsername()`
`int`
`getHoldability()`
`XGConnectionInfo`
`getInfo()`
`protected List<XGConnection.RemoteNode>`
`getInterfaces()`
`protected Optional<XGConnection.RemoteEndpoint>`
`getLastConnectedEndpoint()`
`Optional<SocketAddress>`
`getLocalAddress()`
`int`
`getMajorVersion()`
`DatabaseMetaData`
`getMetaData()`
`int`
`getMinorVersion()`
`int`
`getNetworkTimeout()`
`Properties`
`getProperties()`
`Optional<SocketAddress>`
`getRemoteAddress()`
`String`
`getSchema()`
`String`
`getSchemaLocal()`
`protected Stream<XGConnection.RemoteEndpoint>`
`getSecondaryInterfaces()`
`String`
`getServerVersion()`
`protected long`
`getTimeoutMillis()`
`int`
`getTransactionIsolation()`
`protected SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>`
`getTransport()`
`Map<String,Class<?>>`
`getTypeMap()`
`String`
`getURL()`
`String`
`getUser()`
`String`
`getVersion()`
`SQLWarning`
`getWarnings()`
`protected CompletionStage<CompletableFutures.SQLResult<Void>>`
`initTransport(String ip, int port)`
`protected CompletionStage<CompletableFutures.SQLResult<Void>>`
`initTransportAndBeginHandshake()`
`boolean`
`isClosed()`
`boolean`
`isReadOnly()`
`boolean`
`isValid(int arg0)`
`protected boolean`
`isValidTransport()`
`boolean`
`isWrapperFor(Class<?> iface)`
`static CompletionStage<CompletableFutures.SQLResult<XGConnection>>`
`leaseConnection(XGConnectionInfo info)`
Leases a connection to the database specified by `info`.
`String`
`nativeSQL(String arg0)`
`CallableStatement`
`prepareCall(String arg0)`
`CallableStatement`
`prepareCall(String arg0, int arg1, int arg2)`
`CallableStatement`
`prepareCall(String arg0, int arg1, int arg2, int arg3)`
`PreparedStatement`
`prepareStatement(String arg0)`
`PreparedStatement`
`prepareStatement(String arg0, int arg1)`
`PreparedStatement`
`prepareStatement(String arg0, int[] arg1)`
`PreparedStatement`
`prepareStatement(String arg0, int arg1, int arg2)`
`PreparedStatement`
`prepareStatement(String arg0, int arg1, int arg2, int arg3)`
`PreparedStatement`
`prepareStatement(String arg0, String[] arg1)`
`protected void`
`purgeTimeoutTasks()`
Purges all canceled tasks from the timer.
`static Optional<OktaAuthenticators.OktaNativeSSOToken>`
`readOktaNativeSSOToken(Path tokenFilePath)`
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`reconnect()`
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`reconnect(boolean shouldRequestVersion)`
`void`
`reconnectOrThrow()`
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`redirect(String host, int port, boolean shouldRequestVersion)`
Deprecated.
As of 2.106, callers should close *this* instance and lease a *new* connection to the desired endpoint using `leaseConnection(XGConnectionInfo)` or
invalid reference

    DriverManager#getConnection

.
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`refreshSession()`
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`refreshToken()`
`void`
`releaseSavepoint(Savepoint arg0)`
`protected CompletionStage<CompletableFutures.SQLResult<Void>>`
`reset(boolean forceParameterRefresh)`
`static Path`
`resolveOktaNativeSSOTokenFilePath(Properties properties)`
`void`
`rollback()`
`void`
`rollback(Savepoint arg0)`
`protected CompletionStage<CompletableFutures.SQLResult<Void>>`
`sendHeartbeat()`
Sends a heartbeat message to test the connection with the server asynchronously.
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`sendParameterMessage(ClientWireProtocol.SetParameter param)`
`CompletionStage<CompletableFutures.SQLResult<com.ocient.jdbc.XGConnection.Session.State>>`
`sendRefreshSession()`
`CompletionStage<CompletableFutures.SQLResult<com.ocient.jdbc.XGConnection.Session.State>>`
`sendRefreshToken(com.ocient.jdbc.XGConnection.Session.State oldState)`
`protected <Response> CompletionStage<CompletableFutures.SQLResult<Response>>`
`sendRequest(ClientWireProtocol.Request request, XGConnection.ResponseHandler<Response> responseHandler, Predicate<SQLWarning> warningHandler, XGConnection.ConfirmationSupplier<Response> confirmationSupplier)`
Sends a request message to the remote server and waits for a response.
`protected CompletionStage<CompletableFutures.SQLResult<Void>>`
`sendRequestWithoutResponse(ClientWireProtocol.Request request)`
Sends a request message to the remote server byt does not wait for a response.
`protected CompletionStage<CompletableFutures.SQLResult<ClientWireProtocol.ConfirmationResponse>>`
`sendRequestWithStandardResponse(ClientWireProtocol.Request request, Predicate<SQLWarning> warningHandler)`
Sends a request message to the remote server and waits for a standard confirmation response.
`void`
`setAutoCommit(boolean arg0)`
`void`
`setCatalog(String arg0)`
`void`
`setClientInfo(String arg0, String arg1)`
`void`
`setClientInfo(Properties arg0)`
`boolean`
`setFatalException(Throwable t)`
`void`
`setHoldability(int arg0)`
`int`
`setMaxRows(Integer maxRows, boolean reset)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setMaxRowsHardLimit(Integer maxRows, boolean reset)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setMaxTempDisk(Integer maxTempDisk, boolean reset)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setMaxTime(Integer maxTime, boolean reset)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setMemoryTracing(boolean memoryTracing, boolean reset)`
`static void`
`setMetrics(boolean enabled)`
`void`
`setNetworkTimeout(Executor executor, int milliseconds)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setParallelism(Integer parallelism, boolean reset)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setPriority(Double priority, boolean reset)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setPriorityAdjustFactor(Double priorityAdjustFactor, boolean reset)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setPriorityAdjustTime(Integer priorityAdjustTime, boolean reset)`
`void`
`setReadOnly(boolean arg0)`
`Savepoint`
`setSavepoint()`
`Savepoint`
`setSavepoint(String arg0)`
`void`
`setSchema(String schema)`
`CompletionStage<CompletableFutures.SQLResult<Void>>`
`setSchemaAsync(String schema)`
`void`
`setServerVersion(String version)`
`CompletionStage<CompletableFutures.SQLResult<Integer>>`
`setServiceClassName(String serviceClassName, boolean reset)`
`void`
`setTimeout(int seconds)`
`void`
`setTransactionIsolation(int arg0)`
`void`
`setTypeMap(Map<String,Class<?>> arg0)`
`protected com.ibm.asyncutil.iteration.AsyncIterator<SimplexTransport.StreamCtx<TransportResult<io.netty.buffer.ByteBuf>>>`
`stream(com.ibm.asyncutil.iteration.AsyncIterator<SimplexTransport.StreamCtx<ClientWireProtocol.Request>> requests, int queueDepth)`
Exposes a streaming interface that allows the consumer to apply backpressure.
`static XGConnection`
`TEST_createConnection(XGConnectionInfo info, Map<String,SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>> transportFactories)`
`static XGConnection`
`TEST_createConnection(String user, String pwd, String ip, int portNum, String url, String database, String protocolVersion, XGConnection.Tls tls, CaselessProperties hint_properties, Map<String,SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>> transportFactories)`
`String`
`toString()`
`<T> T`
`unwrap(Class<T> iface)`
`boolean`
`wasRedirected()`
`static void`
`writeOktaNativeSSOToken(Path tokenFilePath, OktaAuthenticators.OktaNativeSSOToken token)`

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

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

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

`beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid`

## Field Details

### USER_HOME_PATH

public static final Path USER_HOME_PATH

### OKTA_NATIVE_SSO_TOKEN_FILE_NAME

public static final String OKTA_NATIVE_SSO_TOKEN_FILE_NAME

See Also:
  - Constant Field Values

### OKTA_NATIVE_SSO_TOKEN_FILE_PATH

public static final Path OKTA_NATIVE_SSO_TOKEN_FILE_PATH

### CLIENT_VERSION

protected static final String CLIENT_VERSION

### DEFAULT_SCHEMA_VALUE

public static final String DEFAULT_SCHEMA_VALUE

See Also:
  - Constant Field Values

### DEFAULT_TRANSPORT_FACTORIES

public static final Map<String,SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>> DEFAULT_TRANSPORT_FACTORIES

### rs

protected XGResultSet rs

### warnings

protected ArrayList<SQLWarning> warnings

### url

protected final String url

### originalIp

protected String originalIp

### connectedIp

protected String connectedIp

### originalPort

protected int originalPort

### connectedPort

protected int connectedPort

### user

protected String user

### fullyQualifiedUsername

protected String fullyQualifiedUsername

### database

protected String database

### client

protected String client

### protocolVersion

protected String protocolVersion

### serverVersion

protected String serverVersion

### oneShotForce

protected boolean oneShotForce

### secondaryInterfaces

protected List<XGConnection.RemoteNode> secondaryInterfaces

### lastConnectedEndpoint

protected Optional<XGConnection.RemoteEndpoint> lastConnectedEndpoint

### networkTimeout

protected OptionalInt networkTimeout

### tls

protected XGConnection.Tls tls

### handshakeDurationCounter

protected DurationCounter handshakeDurationCounter

### sessionID

public static final String sessionID

### metricsEnabled

protected static volatile boolean metricsEnabled

### pwd

protected String pwd

### session

protected XGConnection.Session session

### serverSessionId

protected String serverSessionId

### sessionState

protected com.ocient.jdbc.XGConnection.Session.State sessionState

### typeMap

protected Map<String,Class<?>> typeMap

### properties

protected CaselessProperties properties

### setSchema

protected Optional<String> setSchema

### maxRows

public Integer maxRows

### force

protected boolean force

## Method Details

### getConnectionPropertiesSet

public static HashSet<String> getConnectionPropertiesSet()

### isValidTransport

protected boolean isValidTransport()

### refreshSession

public CompletionStage<CompletableFutures.SQLResult<Void>> refreshSession()

### refreshToken

public CompletionStage<CompletableFutures.SQLResult<Void>> refreshToken()

### getConnectionPoolGauges

public static Set<Gauge> getConnectionPoolGauges()

### getInfo

public XGConnectionInfo getInfo()

### awaitActivation

public CompletionStage<CompletableFutures.SQLResult<Void>> awaitActivation()

### getTransport

protected SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> getTransport() throws SQLException

Throws:
  `SQLException`

### getLocalAddress

public Optional<SocketAddress> getLocalAddress()

### getRemoteAddress

public Optional<SocketAddress> getRemoteAddress() throws SQLException

Throws:
  `SQLException`

### leaseConnection

public static CompletionStage<CompletableFutures.SQLResult<XGConnection>> leaseConnection(XGConnectionInfo info)
Leases a connection to the database specified by `info`.

The returned Connection will have had `XGConnection.XGConnectionFactory.activateObject(XGConnectionInfo, PooledObject)` called with the `info` passed into this method.

IMPORTANT: This is the ONLY way to establish a connection to the database outside of this immediate compilation unit.

FIXME the static method here is a code smell and makes anything that spawns new connections difficult to unit test...

Parameters:
  `info` - the desired connection details
Returns:
  a `CompletableFutures.SQLResult` containing an `XGConnection`

### forkConnection

public XGConnection forkConnection(XGConnectionInfo.Hint hint, boolean hint_bypassLoadBalancerOnHandshakeOnly) throws SQLException
Forks a new XGConnection based on the current connection, with optional hints for connection type.

Parameters:
  `hint` - the hint for the type of connection to fork
  `hint_bypassLoadBalancerOnHandshakeOnly` - set to true to disable redirect on connect
Returns:
  a new XGConnection object based on the current connection, with the specified properties
Throws:
  `SQLException` - if there is an error creating the new connection

### forkConnectionAsync

public CompletionStage<CompletableFutures.SQLResult<XGConnection>> forkConnectionAsync(XGConnectionInfo.Hint hint, boolean hint_bypassLoadBalancerOnHandshakeOnly)

### TEST_createConnection

public static XGConnection TEST_createConnection(XGConnectionInfo info, Map<String,SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>> transportFactories)

### TEST_createConnection

public static XGConnection TEST_createConnection(String user, String pwd, String ip, int portNum, String url, String database, String protocolVersion, XGConnection.Tls tls, CaselessProperties hint_properties, Map<String,SimplexTransportFactory<? extends SimplexTransport<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf>>> transportFactories)

### abort

public void abort(Executor executor) throws SQLException

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

### addTimeout

protected void addTimeout(TimerTask task, long timeout)
Schedules the task to run after the specified delay

Parameters:
  `task` - the task to run
  `timeout` - delay in milliseconds

### setMetrics

public static void setMetrics(boolean enabled)

### clearOneShotForce

public void clearOneShotForce()

### setFatalException

public boolean setFatalException(Throwable t)

### getFatalException

public Optional<Throwable> getFatalException()

### wasRedirected

public boolean wasRedirected()

### clearWarnings

public void clearWarnings() throws SQLException

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

### getDefaultOAuthFlow

public static OpenIDAuthenticators.OAuthFlow getDefaultOAuthFlow()

### resolveOktaNativeSSOTokenFilePath

public static Path resolveOktaNativeSSOTokenFilePath(Properties properties)

### readOktaNativeSSOToken

public static Optional<OktaAuthenticators.OktaNativeSSOToken> readOktaNativeSSOToken(Path tokenFilePath) throws SQLFeatureNotSupportedException, org.jline.reader.UserInterruptException, org.jline.reader.EndOfFileException, FileNotFoundException, IOException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, AuthException, ParseException, com.nimbusds.jose.JOSEException

Throws:
  `SQLFeatureNotSupportedException`
  `org.jline.reader.UserInterruptException`
  `org.jline.reader.EndOfFileException`
  `FileNotFoundException`
  `IOException`
  `InvalidKeyException`
  `NoSuchAlgorithmException`
  `NoSuchPaddingException`
  `IllegalBlockSizeException`
  `BadPaddingException`
  `AuthException`
  `ParseException`
  `com.nimbusds.jose.JOSEException`

### createOktaNativeSSOToken

public static OktaAuthenticators.OktaNativeSSOToken createOktaNativeSSOToken(ClientWireProtocol.OpenIDAuthenticator authenticator, Properties properties) throws KeyManagementException, UnsupportedEncodingException, MalformedURLException, NoSuchAlgorithmException, KeyStoreException, AuthException, IOException, SQLException, URISyntaxException

Throws:
  `KeyManagementException`
  `UnsupportedEncodingException`
  `MalformedURLException`
  `NoSuchAlgorithmException`
  `KeyStoreException`
  `AuthException`
  `IOException`
  `SQLException`
  `URISyntaxException`

### writeOktaNativeSSOToken

public static void writeOktaNativeSSOToken(Path tokenFilePath, OktaAuthenticators.OktaNativeSSOToken token) throws SQLFeatureNotSupportedException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidKeySpecException, InvalidAlgorithmParameterException, UnsupportedEncodingException, IOException, com.nimbusds.jose.JOSEException

Throws:
  `SQLFeatureNotSupportedException`
  `InvalidKeyException`
  `NoSuchAlgorithmException`
  `NoSuchPaddingException`
  `IllegalBlockSizeException`
  `BadPaddingException`
  `InvalidKeySpecException`
  `InvalidAlgorithmParameterException`
  `UnsupportedEncodingException`
  `IOException`
  `com.nimbusds.jose.JOSEException`

### sendHeartbeat

protected CompletionStage<CompletableFutures.SQLResult<Void>> sendHeartbeat()
Sends a heartbeat message to test the connection with the server asynchronously.

Returns:
  a CompletionStage indicating whether the connection test was successful.

### close

public void close() throws SQLException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Connection`
Throws:
  `SQLException`

### closeAsync

public CompletionStage<CompletableFutures.SQLResult<Void>> closeAsync()

### commit

public void commit() throws SQLException

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

### connect

public void connect() throws SQLException

Throws:
  `SQLException`

### initTransport

protected CompletionStage<CompletableFutures.SQLResult<Void>> initTransport(String ip, int port)

### connected

public boolean connected()

### createArrayOf

public Array createArrayOf(String arg0, Object[] arg1) throws SQLException

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

### createBlob

public Blob createBlob() throws SQLException

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

### createClob

public Clob createClob() throws SQLException

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

### createNClob

public NClob createNClob() throws SQLException

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

### createSQLXML

public SQLXML createSQLXML() throws SQLException

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

### createStatement

public Statement createStatement() throws SQLException

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

### createStatement

public Statement createStatement(int arg0, int arg1) throws SQLException

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

### createStatement

public Statement createStatement(int arg0, int arg1, int arg2) throws SQLException

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

### createStruct

public Struct createStruct(String arg0, Object[] arg1) throws SQLException

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

### fetchAuthenticators

public CompletionStage<CompletableFutures.SQLResult<List<ClientWireProtocol.Authenticator>>> fetchAuthenticators()
Fetches all `ClientWireProtocol.Authenticator`s

Returns:
Throws:
  `SQLException`

### fetchServerVersion

protected CompletionStage<CompletableFutures.SQLResult<Void>> fetchServerVersion()
Asynchronously fetches the version of the server.

Returns:
  a CompletionStage that completes when the server version is available, or completes exceptionally if an error occurs while fetching the version.
Throws:
  `IOException` - if an I/O error occurs while sending the request to the server.
  `InterruptedException` - if the RPC to the server is interrupted.

### forceExternal

public void forceExternal(boolean force)

### forceExternalAsync

public CompletionStage<CompletableFutures.SQLResult<Void>> forceExternalAsync(boolean force)

### getAutoCommit

public boolean getAutoCommit() throws SQLException

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

### getCatalog

public String getCatalog() throws SQLException

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

### getClientInfo

public Properties getClientInfo() throws SQLException

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

### getClientInfo

public String getClientInfo(String arg0) throws SQLException

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

### getFullyQualifiedUsername

public String getFullyQualifiedUsername()

### getDB

public String getDB()

### getProperties

public Properties getProperties()

### getHoldability

public int getHoldability() throws SQLException

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

### getMajorVersion

public int getMajorVersion()

### getMetaData

public DatabaseMetaData getMetaData() throws SQLException

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

### getMinorVersion

public int getMinorVersion()

### getNetworkTimeout

public int getNetworkTimeout() throws SQLException

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

### getSchema

public String getSchema() throws SQLException

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

### getSchemaLocal

public String getSchemaLocal()

### getServerVersion

public String getServerVersion()

### getTimeoutMillis

protected long getTimeoutMillis()

### getTransactionIsolation

public int getTransactionIsolation() throws SQLException

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

### getTypeMap

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

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

### getURL

public String getURL()

### getUser

public String getUser()

### getVersion

public String getVersion()

### getWarnings

public SQLWarning getWarnings() throws SQLException

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

### isClosed

public boolean isClosed()

Specified by:
  `isClosed` in interface `Connection`

### isReadOnly

public boolean isReadOnly() throws SQLException

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

### isValid

public boolean isValid(int arg0) throws SQLException

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

### isWrapperFor

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

Specified by:
  `isWrapperFor` in interface `Wrapper`
Throws:
  `SQLException`

### nativeSQL

public String nativeSQL(String arg0) throws SQLException

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

### prepareCall

public CallableStatement prepareCall(String arg0) throws SQLException

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

### prepareCall

public CallableStatement prepareCall(String arg0, int arg1, int arg2) throws SQLException

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

### prepareCall

public CallableStatement prepareCall(String arg0, int arg1, int arg2, int arg3) throws SQLException

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

### prepareStatement

public PreparedStatement prepareStatement(String arg0) throws SQLException

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

### prepareStatement

public PreparedStatement prepareStatement(String arg0, int arg1) throws SQLException

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

### prepareStatement

public PreparedStatement prepareStatement(String arg0, int arg1, int arg2) throws SQLException

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

### prepareStatement

public PreparedStatement prepareStatement(String arg0, int arg1, int arg2, int arg3) throws SQLException

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

### prepareStatement

public PreparedStatement prepareStatement(String arg0, int[] arg1) throws SQLException

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

### prepareStatement

public PreparedStatement prepareStatement(String arg0, String[] arg1) throws SQLException

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

### purgeTimeoutTasks

protected void purgeTimeoutTasks()
Purges all canceled tasks from the timer.

Note: You should only call this if you've canceled a timer. This call may create a `Timer` object if one does not already exist

### reconnectOrThrow

public void reconnectOrThrow() throws SQLException

Throws:
  `SQLException`

### reconnect

public CompletionStage<CompletableFutures.SQLResult<Void>> reconnect()

### reconnect

public CompletionStage<CompletableFutures.SQLResult<Void>> reconnect(boolean shouldRequestVersion)

### getLastConnectedEndpoint

protected Optional<XGConnection.RemoteEndpoint> getLastConnectedEndpoint()

### getInterfaces

protected List<XGConnection.RemoteNode> getInterfaces()

### getSecondaryInterfaces

protected Stream<XGConnection.RemoteEndpoint> getSecondaryInterfaces()

### initTransportAndBeginHandshake

protected CompletionStage<CompletableFutures.SQLResult<Void>> initTransportAndBeginHandshake()

### redirect

@Deprecated public CompletionStage<CompletableFutures.SQLResult<Void>> redirect(String host, int port, boolean shouldRequestVersion)
Deprecated.
As of 2.106, callers should close *this* instance and lease a *new* connection to the desired endpoint using `leaseConnection(XGConnectionInfo)` or
invalid reference

    DriverManager#getConnection

.

Parameters:
  `host` -
  `port` -
  `shouldRequestVersion` -
Returns:

### releaseSavepoint

public void releaseSavepoint(Savepoint arg0) throws SQLException

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

### reset

protected CompletionStage<CompletableFutures.SQLResult<Void>> reset(boolean forceParameterRefresh)

### rollback

public void rollback() throws SQLException

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

### rollback

public void rollback(Savepoint arg0) throws SQLException

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

### sendParameterMessage

public CompletionStage<CompletableFutures.SQLResult<Integer>> sendParameterMessage(ClientWireProtocol.SetParameter param)

### setAutoCommit

public void setAutoCommit(boolean arg0) throws SQLException

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

### setCatalog

public void setCatalog(String arg0) throws SQLException

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

### setClientInfo

public void setClientInfo(Properties arg0) throws SQLClientInfoException

Specified by:
  `setClientInfo` in interface `Connection`
Throws:
  `SQLClientInfoException`

### setClientInfo

public void setClientInfo(String arg0, String arg1) throws SQLClientInfoException

Specified by:
  `setClientInfo` in interface `Connection`
Throws:
  `SQLClientInfoException`

### setParallelism

public CompletionStage<CompletableFutures.SQLResult<Integer>> setParallelism(Integer parallelism, boolean reset)

### setHoldability

public void setHoldability(int arg0) throws SQLException

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

### setMaxRows

public int setMaxRows(Integer maxRows, boolean reset)

### setMaxRowsHardLimit

public CompletionStage<CompletableFutures.SQLResult<Integer>> setMaxRowsHardLimit(Integer maxRows, boolean reset)

### setMaxTempDisk

public CompletionStage<CompletableFutures.SQLResult<Integer>> setMaxTempDisk(Integer maxTempDisk, boolean reset)

### setMaxTime

public CompletionStage<CompletableFutures.SQLResult<Integer>> setMaxTime(Integer maxTime, boolean reset)

### setNetworkTimeout

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

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

### setPriority

public CompletionStage<CompletableFutures.SQLResult<Integer>> setPriority(Double priority, boolean reset)

### setPriorityAdjustFactor

public CompletionStage<CompletableFutures.SQLResult<Integer>> setPriorityAdjustFactor(Double priorityAdjustFactor, boolean reset)

### setServiceClassName

public CompletionStage<CompletableFutures.SQLResult<Integer>> setServiceClassName(String serviceClassName, boolean reset)

### setPriorityAdjustTime

public CompletionStage<CompletableFutures.SQLResult<Integer>> setPriorityAdjustTime(Integer priorityAdjustTime, boolean reset)

### setMemoryTracing

public CompletionStage<CompletableFutures.SQLResult<Integer>> setMemoryTracing(boolean memoryTracing, boolean reset)

### setReadOnly

public void setReadOnly(boolean arg0) throws SQLException

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

### setSavepoint

public Savepoint setSavepoint() throws SQLException

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

### setSavepoint

public Savepoint setSavepoint(String arg0) throws SQLException

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

### setSchemaAsync

public CompletionStage<CompletableFutures.SQLResult<Void>> setSchemaAsync(String schema)

### setSchema

public void setSchema(String schema) throws SQLException

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

### setServerVersion

public void setServerVersion(String version)

### setTimeout

public void setTimeout(int seconds) throws SQLException

Throws:
  `SQLException`

### setTransactionIsolation

public void setTransactionIsolation(int arg0) throws SQLException

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

### setTypeMap

public void setTypeMap(Map<String,Class<?>> arg0) throws SQLException

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

### unwrap

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

Specified by:
  `unwrap` in interface `Wrapper`
Throws:
  `SQLException`

### sendRefreshSession

public CompletionStage<CompletableFutures.SQLResult<com.ocient.jdbc.XGConnection.Session.State>> sendRefreshSession()

### sendRefreshToken

public CompletionStage<CompletableFutures.SQLResult<com.ocient.jdbc.XGConnection.Session.State>> sendRefreshToken(com.ocient.jdbc.XGConnection.Session.State oldState)

### deserializeProto

protected static <Response, ResponseBuilder extends com.google.protobuf.GeneratedMessageV3.Builder<?>> Response deserializeProto(ResponseBuilder builder, io.netty.buffer.ByteBuf wireMessage) throws IOException
Deserializes a protobuf message from a ByteBuf.

Type Parameters:
  `Response` - the response type of the protobuf message
  `ResponseBuilder` - the builder type of the protobuf message
Parameters:
  `builder` - a supplier of the builder for the protobuf message
  `wireMessage` - the ByteBuf containing the wire-encoded protobuf message
Returns:
  the deserialized protobuf message
Throws:
  `IOException` - if an I/O error occurs while reading the ByteBuf

### sendRequestWithStandardResponse

protected CompletionStage<CompletableFutures.SQLResult<ClientWireProtocol.ConfirmationResponse>> sendRequestWithStandardResponse(ClientWireProtocol.Request request, Predicate<SQLWarning> warningHandler)
Sends a request message to the remote server and waits for a standard confirmation response.

Parameters:
  `request` - the request message to send to the server
Returns:
  a `CompletionStage` representing the completion of the request and response

### sendRequest

protected <Response> CompletionStage<CompletableFutures.SQLResult<Response>> sendRequest(ClientWireProtocol.Request request, XGConnection.ResponseHandler<Response> responseHandler, Predicate<SQLWarning> warningHandler, XGConnection.ConfirmationSupplier<Response> confirmationSupplier)
Sends a request message to the remote server and waits for a response. Warnings should be handled via the `warningHAndler`.

Type Parameters:
  `Response` - the type of the response message
Parameters:
  `request` - the request message to send to the server
  `responseHandler` - the response handler used to parse the response message
  `getHeader` - a function used to extract the confirmation header from the response message
Returns:
  a `CompletionStage` representing the completion of the request and response

### stream

protected com.ibm.asyncutil.iteration.AsyncIterator<SimplexTransport.StreamCtx<TransportResult<io.netty.buffer.ByteBuf>>> stream(com.ibm.asyncutil.iteration.AsyncIterator<SimplexTransport.StreamCtx<ClientWireProtocol.Request>> requests, int queueDepth)
Exposes a streaming interface that allows the consumer to apply backpressure. The recipient's recv queue will contain up to `queueDepth` requests at any given time. Completion callbacks for each response are applied by the consumer of the returned iterator.

### sendRequestWithoutResponse

protected CompletionStage<CompletableFutures.SQLResult<Void>> sendRequestWithoutResponse(ClientWireProtocol.Request request)
Sends a request message to the remote server byt does not wait for a response.

Parameters:
  `request` - the request message to send to the server
Returns:
  a `CompletionStage` representing the completion of the request

### toString

public String toString()

Overrides:
  `toString` in class `Object`