Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gaohongtao committed Jan 20, 2017
2 parents 73fc752 + 3c68480 commit ceab918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sharding-jdbc-doc/content/02-guide/hint-sharding-value.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ __现有一个假设,如果`WHERE`中没有`user_id`和`order_id`的条件,
String sql = "SELECT * FROM t_order";

try (
HintManager hintManager = new HintManager();
HintManager hintManager = HintManager.getInstance();
Connection conn = dataSource.getConnection();
PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
hintManager.addDatabaseShardingValue("t_order", "user_id", 1);
Expand All @@ -50,7 +50,7 @@ try (
```

### 实例化
使用`HintManager hintManager = new HintManager()`实例化后将初始化`ThreadLocal`中的数据。
使用`HintManager hintManager = HintManager.getInstance()`实例化后将初始化`ThreadLocal`中的数据。

### 添加分片键值
- 使用`hintManager.addDatabaseShardingValue`来添加数据源分片键值
Expand Down

0 comments on commit ceab918

Please sign in to comment.