This is an automated email from the ASF dual-hosted git repository.
zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 62940ae0be3 Update shardingsphere-jdbc-quick-start.cn.md (#18092)
62940ae0be3 is described below
commit 62940ae0be33d5584499328fa1e23c4118eaf22e
Author: Mike0601 <[email protected]>
AuthorDate: Tue May 31 15:37:01 2022 +0800
Update shardingsphere-jdbc-quick-start.cn.md (#18092)
---
.../shardingsphere-jdbc-quick-start.cn.md | 52 ++++++++++++++++++----
1 file changed, 43 insertions(+), 9 deletions(-)
diff --git
a/docs/document/content/quick-start/shardingsphere-jdbc-quick-start.cn.md
b/docs/document/content/quick-start/shardingsphere-jdbc-quick-start.cn.md
index eb8d0412604..04b86e2c6e6 100644
--- a/docs/document/content/quick-start/shardingsphere-jdbc-quick-start.cn.md
+++ b/docs/document/content/quick-start/shardingsphere-jdbc-quick-start.cn.md
@@ -4,28 +4,62 @@ title = "ShardingSphere-JDBC"
weight = 1
+++
-## 引入 maven 依赖
+## 应用场景
+
+Apache ShardingSphere-JDBC 可以通过 `Java`,`YAML`,`Spring 命名空间` 和 `Spring Boot
Starter` 这 4 种方式进行配置,开发者可根据场景选择适合的配置方式。
+
+## 使用限制
+
+目前仅支持 JAVA 语言
+
+## 前提条件
+
+开发环境需要具备 Java JRE 8 或更高版本。
+
+## 操作步骤
+
+
+1. 规则配置。
+
+详情请参见[用户手册](/cn/user-manual/shardingsphere-jdbc/)。
+
+2. 引入 maven 依赖。
```xml
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc-core</artifactId>
+ <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
<version>${latest.release.version}</version>
</dependency>
```
> 注意:请将 `${latest.release.version}` 更改为实际的版本号。
-## 规则配置
-ShardingSphere-JDBC 可以通过 `Java`,`YAML`,`Spring 命名空间` 和 `Spring Boot Starter` 这
4 种方式进行配置,开发者可根据场景选择适合的配置方式。
-详情请参见[用户手册](/cn/user-manual/shardingsphere-jdbc/)。
-## 创建数据源
+3. 编辑 `application.yml`。
+
-通过 `ShardingSphereDataSourceFactory` 工厂和规则配置对象获取 `ShardingSphereDataSource`。
-该对象实现自 JDBC 的标准 DataSource 接口,可用于原生 JDBC 开发,或使用 JPA, Hibernate, MyBatis 等 ORM
类库。
```java
-DataSource dataSource =
ShardingSphereDataSourceFactory.createDataSource(schemaName, modeConfig,
dataSourceMap, ruleConfigs, props);
+spring:
+ shardingsphere:
+ datasource:
+ names: ds_0, ds_1
+ ds_0:
+ type: com.zaxxer.hikari.HikariDataSource
+ driverClassName: com.mysql.cj.jdbc.Driver
+ jdbcUrl:
jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+ username: root
+ password:
+ ds_1:
+ type: com.zaxxer.hikari.HikariDataSource
+ driverClassName: com.mysql.cj.jdbc.Driver
+ jdbcUrl:
jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+ username: root
+ password:
+ rules:
+ sharding:
+ tables:
+ ...
```