ListShardMapper.openConnectionForKey Method

Definition

Overloads

openConnectionForKey(Object key, String connectionString)

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

openConnectionForKey(Object key, String connectionString, ConnectionOptions options)

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

openConnectionForKey(Object key, String connectionString)

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

public Connection openConnectionForKey(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

Connection

An opened SqlConnection.

openConnectionForKey(Object key, String connectionString, ConnectionOptions options)

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

public Connection openConnectionForKey(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

Connection

An opened SqlConnection.

Applies to