Package oracle.jdbc
Interface OracleShardingKeyBuilder
-
- All Superinterfaces:
ShardingKeyBuilder
- All Known Implementing Classes:
OracleShardingKeyBuilderImpl
public interface OracleShardingKeyBuilder extends ShardingKeyBuilder
A builder created from aOracleDataSource
orOracleXADataSource
orOracleConnectionPoolDataSource
object, used to create aOracleShardingKey
with sub-keys of supported data types.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();
- Since:
- 12.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OracleShardingKey
build()
Builds the Sharding key.OracleShardingKeyBuilder
subkey(Object key, SQLType subkeyType)
This method is called to include a subkey into a sharding Key object being built.
-
-
-
Method Detail
-
subkey
OracleShardingKeyBuilder subkey(Object key, SQLType subkeyType)
This method is called to include a subkey into a sharding Key object being built. The order in which subkey method is called is important as it indicates the order of placement of the subkey within the sharding key.- Specified by:
subkey
in interfaceShardingKeyBuilder
- Parameters:
key
- contains the sharding sub-key object.subkeyType
- sharding sub-key data type.- Returns:
- this
OracleShardingKeyBuilder
object
-
build
OracleShardingKey build() throws SQLException
Builds the Sharding key.- Specified by:
build
in interfaceShardingKeyBuilder
- Returns:
- new
OracleShardingKey
object that is built. - Throws:
SQLException
- if there is an error while building the Sharding key.
-
-