2020-06-17 11:58:11 +08:00
|
|
|
|
# budo-jdbc
|
|
|
|
|
|
|
|
|
|
#### 介绍
|
|
|
|
|
|
2020-06-17 12:29:00 +08:00
|
|
|
|
SQL-ON-NO-SQL
|
2020-06-17 11:58:11 +08:00
|
|
|
|
|
2020-06-17 12:29:00 +08:00
|
|
|
|
帮助你实现用 SQL ( JDBC ) 来操作 Mongo/ES/Solr/HBase 等 NoSQL存储
|
2020-06-17 11:58:11 +08:00
|
|
|
|
|
2020-06-17 13:05:22 +08:00
|
|
|
|
## 使用方式
|
|
|
|
|
|
|
|
|
|
一句话描述:就和你之前使用MySQL数据库一样的使用Mongo/ES等
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
// 测试方法
|
|
|
|
|
public static void main(String[] args) throws Throwable {
|
|
|
|
|
// 注册驱动,像之前用过的MySQL一样
|
|
|
|
|
Class.forName("org.budo.mongo.jdbc.driver.BudoMongoJdbcDriver");
|
|
|
|
|
// 获取连接
|
|
|
|
|
Connection connection = DriverManager.getConnection("jdbc:mongo://192.168.4.32:27017/taobao");
|
|
|
|
|
// 执行更新语句
|
|
|
|
|
connection.createStatement().executeUpdate("INSERT INTO t_sample_0_user_0(id, name) VALUES(1, 'aaa')");
|
|
|
|
|
// 查询
|
|
|
|
|
ResultSet resultSet = connection.createStatement().executeQuery("SELECT * FROM t_sample_0_user_0");
|
|
|
|
|
// TODO 打印ResultSet
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
然后,你可以使用 DataSource Mybatis 等你之前熟悉的所有工具
|
|
|
|
|
|
2021-08-30 10:17:40 +08:00
|
|
|
|
#### PS
|
|
|
|
|
|
|
|
|
|
对接上 `budo-sharding-proxy` 后;你还可以用类似 `Navicat` 的工具连接并用 `SQL` 操作上面的资源
|
|
|
|
|
|
2020-06-17 12:51:46 +08:00
|
|
|
|
#### 子项目
|
|
|
|
|
|
|
|
|
|
[budo-jdbc-driver](budo-jdbc-driver)
|
|
|
|
|
|
|
|
|
|
[budo-csv-jdbc-driver](budo-csv-jdbc-driver)
|
|
|
|
|
|
|
|
|
|
[budo-elasticsearch-jdbc-driver](budo-elasticsearch-jdbc-driver)
|
|
|
|
|
|
|
|
|
|
[budo-excel-jdbc-driver](budo-excel-jdbc-driver)
|
|
|
|
|
|
|
|
|
|
[budo-hbase-jdbc-driver](budo-hbase-jdbc-driver)
|
|
|
|
|
|
|
|
|
|
[budo-kafka-jdbc-driver](budo-kafka-jdbc-driver)
|
|
|
|
|
|
|
|
|
|
[budo-mongo-jdbc-driver](budo-mongo-jdbc-driver)
|
|
|
|
|
|
|
|
|
|
[budo-redis-jdbc-driver](budo-redis-jdbc-driver)
|
|
|
|
|
|
|
|
|
|
[budo-solr-jdbc-driver](budo-solr-jdbc-driver)
|
|
|
|
|
|
2020-06-17 12:29:00 +08:00
|
|
|
|
#### 链接
|
2020-06-17 12:51:46 +08:00
|
|
|
|
|
2020-06-17 12:54:52 +08:00
|
|
|
|
[apache-shardingsphere-proxy](https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-proxy-quick-start/)
|
|
|
|
|
|
2020-06-17 12:52:34 +08:00
|
|
|
|
[budo-common](https://gitee.com/budogroup/budo-common)
|