< prev index next >

jdk/src/java.sql/share/classes/java/sql/ShardingKey.java

Print this page




  52  * The following example illustrates the use of {@link ShardingKeyBuilder} to
  53  * create a {@code superShardingKey} for an eastern region with a
  54  * {@code ShardingKey} specified for the Pittsburgh branch office:
  55  * <pre>
  56  * {@code
  57  *
  58  *     DataSource ds = new MyDataSource();
  59  *     ShardingKey superShardingKey = ds.createShardingKeyBuilder()
  60  *                           .subkey("EASTERN_REGION", JDBCType.VARCHAR)
  61  *                           .build();
  62  *     ShardingKey shardingKey = ds.createShardingKeyBuilder()
  63  *                           .subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR)
  64  *                           .build();
  65  *     Connection con = ds.createConnectionBuilder()
  66  *                           .superShardingKey(superShardingKey)
  67  *                           .shardingKey(shardingKey)
  68  *                           .build();
  69  * }
  70  * </pre>
  71  *
  72  * @since 1.9
  73  */
  74 public interface ShardingKey {
  75 
  76 }


  52  * The following example illustrates the use of {@link ShardingKeyBuilder} to
  53  * create a {@code superShardingKey} for an eastern region with a
  54  * {@code ShardingKey} specified for the Pittsburgh branch office:
  55  * <pre>
  56  * {@code
  57  *
  58  *     DataSource ds = new MyDataSource();
  59  *     ShardingKey superShardingKey = ds.createShardingKeyBuilder()
  60  *                           .subkey("EASTERN_REGION", JDBCType.VARCHAR)
  61  *                           .build();
  62  *     ShardingKey shardingKey = ds.createShardingKeyBuilder()
  63  *                           .subkey("PITTSBURGH_BRANCH", JDBCType.VARCHAR)
  64  *                           .build();
  65  *     Connection con = ds.createConnectionBuilder()
  66  *                           .superShardingKey(superShardingKey)
  67  *                           .shardingKey(shardingKey)
  68  *                           .build();
  69  * }
  70  * </pre>
  71  *
  72  * @since 9
  73  */
  74 public interface ShardingKey {
  75 
  76 }
< prev index next >