Package oracle.jdbc
Interface OracleShardingKey
-
- All Superinterfaces:
Comparable<OracleShardingKey>
,ShardingKey
- All Known Implementing Classes:
OracleShardingKeyImpl
public interface OracleShardingKey extends Comparable<OracleShardingKey>, ShardingKey
Interface used to indicate that this object represents a Oracle Sharding Key. AOracleShardingKey
instance is only guaranteed to be compatible with the oracle data source instance that it was derived from. AOracleShardingKey
is created usingOracleShardingKeyBuilder
.The following example illustrates the use of
OracleShardingKeyBuilder
to create aOracleShardingKey
:OracleDataSource ods = new oracle.jdbc.pool.OracleDataSource(); OracleShardingKey shardingKey = ods.createShardingKeyBuilder() .subkey("Customer_Name_XYZ", JDBCType.VARCHAR) .subkey(94002, JDBCType.NUMERIC) .build();
A
OracleShardingKey
may also be used for specifying asuperShardingKey
. Databases that support composite Sharding may use asuperShardingKey
to specify a additional level of partitioning within the Shard.The following example illustrates the use of
OracleShardingKeyBuilder
to create asuperShardingKey
for an eastern region with aOracleShardingKey
specified for the Pittsburgh branch office:OracleDataSource ods = new oracle.pool.OracleDataSource(); OracleShardingKey superShardingKey = ods.createShardingKeyBuilder() .subkey("EASTERN_REGION", JDBCType.VARCHAR) .build(); OracleShardingKey shardingKey = ods.createShardingKeyBuilder() .subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR) .build(); OracleConnection conn = ods.createConnectionBuilder() .superShardingKey(superShardingKey) .shardingKey(shardingKey) .build();
- Since:
- 12.2
-
-
Method Summary
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-