Package Summary Overview Summary |
public interface PooledConnectionBuilder
ConnectionPoolDataSource
object, used to establish a connection to the database that the data source
object represents. The connection properties that were specified for the data source
are used as the default values by the PooledConnectionBuilder
.
The following example illustrates the use of PooledConnectionBuilder
to create a 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();
Modifier and Type | Method | Description |
---|---|---|
PooledConnection | build() |
Returns an instance of the object defined by this builder.
|
PooledConnectionBuilder | password(java.lang.String password) |
Specifies the password to be used when creating a connection
|
PooledConnectionBuilder | shardingKey(ShardingKey shardingKey) |
Specifies a
shardingKey to be used when creating a connection
|
PooledConnectionBuilder | superShardingKey(ShardingKey superShardingKey) |
Specifies a
superShardingKey to be used when creating a connection
|
PooledConnectionBuilder | user(java.lang.String username) |
Specifies the username to be used when creating a connection
|
PooledConnectionBuilder user(java.lang.String username)
username
- the database user on whose behalf the connection is being made
PooledConnectionBuilder
instance
PooledConnectionBuilder password(java.lang.String password)
password
- the password to use for this connection. May be null
PooledConnectionBuilder
instance
PooledConnectionBuilder shardingKey(ShardingKey shardingKey)
shardingKey
to be used when creating a connection
shardingKey
- the ShardingKey. May be null
PooledConnectionBuilder
instance
ShardingKey
, ShardingKeyBuilder
PooledConnectionBuilder superShardingKey(ShardingKey superShardingKey)
superShardingKey
to be used when creating a connection
superShardingKey
- the SuperShardingKey. May be null
PooledConnectionBuilder
instance
ShardingKey
, ShardingKeyBuilder
PooledConnection build() throws SQLException
SQLException
- If an error occurs building the object