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 ccdf0b6f6d3 Update shardingsphere-jdbc-quick-start.en.md (#18094)
ccdf0b6f6d3 is described below
commit ccdf0b6f6d38b85dd3ca486588a6fbb0047b3a98
Author: Mike0601 <[email protected]>
AuthorDate: Tue May 31 15:58:02 2022 +0800
Update shardingsphere-jdbc-quick-start.en.md (#18094)
---
.../shardingsphere-jdbc-quick-start.en.md | 52 +++++++++++++++++-----
1 file changed, 42 insertions(+), 10 deletions(-)
diff --git
a/docs/document/content/quick-start/shardingsphere-jdbc-quick-start.en.md
b/docs/document/content/quick-start/shardingsphere-jdbc-quick-start.en.md
index 20fd84d2894..6de2fad8dda 100644
--- a/docs/document/content/quick-start/shardingsphere-jdbc-quick-start.en.md
+++ b/docs/document/content/quick-start/shardingsphere-jdbc-quick-start.en.md
@@ -4,29 +4,61 @@ title = "ShardingSphere-JDBC"
weight = 1
+++
-## Import Maven Dependency
+## Scenarios
+
+Apache ShardingSphere can be configured by four methods, `Java`, `YAML`,
`Spring namespace` and `Spring boot starter`.
+Developers can choose the suitable method according to different situations.
+
+## Restrictions
+
+Currently only Java language is supported.
+
+## Prerequisites
+
+The development environment requires Java JRE 8 or later.
+
+## Procedure
+
+1. Rules configuration.
+
+Please refer to [User Manual](/en/user-manual/shardingsphere-jdbc/) for more
details.
+
+2. Import Maven dependency
```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>
```
> Notice: Please change `${latest.release.version}` to the actual version.
-## Rules Configuration
-ShardingSphere-JDBC can be configured by four methods, `Java`, `YAML`, `Spring
namespace` and `Spring boot starter`.
-Developers can choose the suitable method according to different situations.
-Please refer to [User Manual](/en/user-manual/shardingsphere-jdbc/) for more
details.
-## 3. Create Data Source
+3. Edit `application.yml`.
-Use `ShardingSphereDataSourceFactory` and rule configurations to create
`ShardingSphereDataSource`, which implements DataSource interface of JDBC.
-It can be used for native JDBC or JPA, Hibernate, MyBatis and other ORM
frameworks.
```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:
+ ...
```