This is an automated email from the ASF dual-hosted git repository.
jianglongtao 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 dffb1f0ac75 Add document of data source for proxy (#28475)
dffb1f0ac75 is described below
commit dffb1f0ac75e9957d7a1a9758fb5583b3b8ce356
Author: ChenJiaHao <[email protected]>
AuthorDate: Wed Sep 20 17:36:25 2023 +0800
Add document of data source for proxy (#28475)
* Add document of data source for proxy
* Fix document
* Fix document
* Fix document
* Fix document
* Fix document
---
.../yaml-config/data-source.en.md | 10 ++---
.../yaml-config/data-source.cn.md | 44 ++++++++++++++++++++++
.../yaml-config/data-source.en.md | 44 ++++++++++++++++++++++
3 files changed, 93 insertions(+), 5 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md
index d5bf857296f..e8595212d21 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md
@@ -6,7 +6,7 @@ chapter = true
## Background
-ShardingSphere-JDBC Supports all JDBC drivers and database connection pools.
+ShardingSphere-JDBC Supports all JDBC drivers and data source connection pools.
In this example, the database driver is MySQL, and the connection pool is
HikariCP, which can be replaced with other database drivers and connection
pools.
When using ShardingSphere JDBC, the property name of the JDBC pool depends on
the definition of the respective JDBC pool and is not defined by
ShardingSphere. For related processing, please refer to the class
org.apache.shardingsphere.infra.datasource.pool.creator.DataSourcePoolCreator.
@@ -18,10 +18,10 @@ For example, with Alibaba Druid 1.2.9, using url instead of
jdbcUrl in the examp
dataSources: # Data sources configuration, multiple <data-source-name>
available
<data_source_name>: # Data source name
dataSourceClassName: # Data source class name
- driverClassName: # The database driver class name is subject to the
configuration of the database connection pool itself
- jdbcUrl: # The database URL connection is subject to the configuration of
the database connection pool itself
- username: # Database user name, subject to the configuration of the
database connection pool itself
- password: # The database password is subject to the configuration of the
database connection pool itself
+ driverClassName: # The database driver class name is subject to the
configuration of the data source connection pool itself
+ jdbcUrl: # The database URL connection is subject to the configuration of
the data source connection pool itself
+ username: # Database username, subject to the configuration of the data
source connection pool itself
+ password: # The database password is subject to the configuration of the
data source connection pool itself
# ... Other properties of data source pool
```
## Sample
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md
new file mode 100644
index 00000000000..51cc806077f
--- /dev/null
+++
b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.cn.md
@@ -0,0 +1,44 @@
++++
+title = "数据源配置"
+weight = 4
+chapter = true
++++
+
+## 背景信息
+
+ShardingSphere-Proxy 支持常见的数据库连接池: HikariCP、C3P0、DBCP。
+
+可以通过参数 `dataSourceClassName` 指定连接池,当不指定时,默认的的数据库连接池为 HikariCP。
+
+## 参数解释
+
+```yaml
+dataSources: # 数据源配置,可配置多个 <data-source-name>
+ <data_source_name>: # 数据源名称
+ dataSourceClassName: # 数据源连接池完整类名
+ url: # 数据库 URL 连接
+ username: # 数据库用户名
+ password: # 数据库密码
+ # ... 数据库连接池的其它属性
+```
+## 配置示例
+
+```yaml
+dataSources:
+ ds_1:
+ url: jdbc:mysql://localhost:3306/ds_1
+ username: root
+ password:
+ ds_2:
+ dataSourceClassName: com.mchange.v2.c3p0.ComboPooledDataSource
+ url: jdbc:mysql://localhost:3306/ds_2
+ username: root
+ password:
+ ds_3:
+ dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource
+ url: jdbc:mysql://localhost:3306/ds_3
+ username: root
+ password:
+
+ # 配置其他数据源
+```
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md
new file mode 100644
index 00000000000..0f44b850757
--- /dev/null
+++
b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/data-source.en.md
@@ -0,0 +1,44 @@
++++
+title = "Data Source"
+weight = 4
+chapter = true
++++
+
+## Background
+
+ShardingSphere-Proxy supports common data source connection pools: HikariCP,
C3P0, DBCP.
+
+The connection pool can be specified through the parameter
`dataSourceClassName`. When not specified, the default data source connection
pool is HikariCP.
+
+## Parameters
+
+```yaml
+dataSources: # Data sources configuration, multiple <data-source-name>
available
+ <data_source_name>: # Data source name
+ dataSourceClassName: # Data source connection pool full class name
+ url: # The database URL connection
+ username: # Database username
+ password: # The database password
+ # ... Other properties of data source pool
+```
+## Sample
+
+```yaml
+dataSources:
+ ds_1:
+ url: jdbc:mysql://localhost:3306/ds_1
+ username: root
+ password:
+ ds_2:
+ dataSourceClassName: com.mchange.v2.c3p0.ComboPooledDataSource
+ url: jdbc:mysql://localhost:3306/ds_2
+ username: root
+ password:
+ ds_3:
+ dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource
+ url: jdbc:mysql://localhost:3306/ds_3
+ username: root
+ password:
+
+ # Configure other data sources
+```