ListShardMapper.openConnectionForKeyAsync Method

Definition

Overloads

openConnectionForKeyAsync(Object key, String connectionString)

Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value.

openConnectionForKeyAsync(Object key, String connectionString, ConnectionOptions options)

Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value.

openConnectionForKeyAsync(Object key, String connectionString)

Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value.

public Callable<Connection> openConnectionForKeyAsync(Object key, String connectionString)

Parameters

key
Object

Input key value.

connectionString
String

Connection string with credential information, the DataSource and Database are obtained from the results of the lookup operation for key.

Returns

Callable<Connection>

A Task encapsulating an opened SqlConnection. All non usage-error exceptions will be reported via the returned Task

openConnectionForKeyAsync(Object key, String connectionString, ConnectionOptions options)

Given a key value, asynchronously obtains a SqlConnection to the shard in the mapping that contains the key value.

public Callable<Connection> openConnectionForKeyAsync(Object key, String connectionString, ConnectionOptions options)

Parameters

key
Object

Input key value.

connectionString
String

Connection string with credential information, the DataSource and Database are obtained from the results of the lookup operation for key.

options
ConnectionOptions

Options for validation operations to perform on opened connection.

Returns

Callable<Connection>

A Task encapsulating an opened SqlConnection. All non usage-error exceptions will be reported via the returned Task

Applies to