public interface ShardingKey
ShardingKey instance is only guaranteed to be compatible with the
data source instance that it was derived from. A ShardingKey is
created using ShardingKeyBuilder.
The following example illustrates the use of ShardingKeyBuilder to
create a ShardingKey:
DataSource ds = new MyDataSource();
ShardingKey shardingKey = ds.createShardingKeyBuilder()
.subkey("abc", JDBCType.VARCHAR)
.subkey(94002, JDBCType.INTEGER)
.build();
The following example illustrates the use of ShardingKeyBuilder with a
ShardingKey specified for the Pittsburgh branch office:
DataSource ds = new MyDataSource();
ShardingKey shardingKey = ds.createShardingKeyBuilder()
.subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR)
.build();
Connection con = ds.createConnectionBuilder()
.shardingKey(shardingKey)
.build();
Copyright © 2026 Picodata. All rights reserved.