This commit is contained in:
黎明伟 2020-06-18 12:38:26 +08:00
parent 48589cb208
commit 28928b1b15
1 changed files with 6 additions and 3 deletions

View File

@ -1,19 +1,22 @@
# budo-sharding-proxy
```
// Mongo 连接地址
private static final String URL = "jdbc:mongo://192.168.4.32:27017/taobao";
public static void main(String[] args) {
BudoShardingProxy budoShardingProxy = new BudoShardingProxy();
budoShardingProxy.target() //
budoShardingProxy.target() // 将查询转发到指定地址,使用指定驱动
.setUrl(URL) //
.setDriver(BudoMongoJdbcDriver.class.getName());
.setDriver(BudoMongoJdbcDriver.class.getName()); // 实现了使用SQL操作Mongo的驱动
budoShardingProxy.start();
budoShardingProxy.start(); // 启动ShardingProxy
}
```
## 资料
[shardingsphere-proxy-boot-mybatis-example](https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-proxy-example/shardingsphere-proxy-boot-mybatis-example/src/main/resources/conf)
[shardingsphere-proxy-hint-example](https://github.com/apache/shardingsphere/tree/master/examples/shardingsphere-proxy-example/shardingsphere-proxy-hint-example/src/main/resources/conf)