-
public interface PooledConnectionBuilder
ConnectionPoolDataSource
オブジェクトから作成されたビルダー。data source
オブジェクトが表すデータベースへの接続を確立するために使用されます。data source
に指定された接続プロパティは、PooledConnectionBuilder
によってデフォルト値として使用されます。次の例は、
PooledConnectionBuilder
を使用してXAConnection
を作成する方法を示しています:ConnectionPoolDataSource ds = new MyConnectionPoolDataSource(); ShardingKey superShardingKey = ds.createShardingKeyBuilder() .subkey("EASTERN_REGION", JDBCType.VARCHAR) .build(); ShardingKey shardingKey = ds.createShardingKeyBuilder() .subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR) .build(); PooledConnection con = ds.createPooledConnectionBuilder() .user("rafa") .password("tennis") .setShardingKey(shardingKey) .setSuperShardingKey(superShardingKey) .build();
- 導入されたバージョン:
- 9
-
-
メソッドのサマリー
修飾子と型 メソッド 説明 PooledConnection
build()
このBuilderによって定義されたオブジェクトのインスタンスを返します。PooledConnectionBuilder
password(String password)
接続を作成するときに使用するパスワードを指定しますPooledConnectionBuilder
shardingKey(ShardingKey shardingKey)
接続を作成するときに使用するshardingKey
を指定PooledConnectionBuilder
superShardingKey(ShardingKey superShardingKey)
接続を作成するときに使用するsuperShardingKey
を指定PooledConnectionBuilder
user(String username)
接続を作成するときに使用するユーザー名を指定
-
-
-
メソッドの詳細
-
user
PooledConnectionBuilder user(String username)
接続を作成するときに使用するユーザー名を指定- パラメータ:
username
- その代理として接続が行われるデータベース・ユーザー- 戻り値:
- 同じ
PooledConnectionBuilder
インスタンス
-
password
PooledConnectionBuilder password(String password)
接続を作成するときに使用するパスワードを指定します- パラメータ:
password
- この接続に使用するパスワード。null
の可能性がある- 戻り値:
- 同じ
PooledConnectionBuilder
インスタンス
-
shardingKey
PooledConnectionBuilder shardingKey(ShardingKey shardingKey)
接続を作成するときに使用するshardingKey
を指定- パラメータ:
shardingKey
- ShardingKey。null
の可能性がある- 戻り値:
- 同じ
PooledConnectionBuilder
インスタンス - 関連項目:
ShardingKey
,ShardingKeyBuilder
-
superShardingKey
PooledConnectionBuilder superShardingKey(ShardingKey superShardingKey)
接続を作成するときに使用するsuperShardingKey
を指定- パラメータ:
superShardingKey
- SuperShardingKey。null
の可能性がある- 戻り値:
- 同じ
PooledConnectionBuilder
インスタンス - 関連項目:
ShardingKey
,ShardingKeyBuilder
-
build
PooledConnection build() throws SQLException
このBuilderによって定義されたオブジェクトのインスタンスを返します。- 戻り値:
- 構築されたオブジェクト
- 例外:
SQLException
- オブジェクトの構築中にエラーが発生した場合
-
-