You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/02/16 16:52:38 UTC

[shardingsphere] branch master updated: Add document for ShardingsphereDriverURLProvider spi (#24203)

This is an automated email from the ASF dual-hosted git repository.

zhangliang 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 2b2c8a93643 Add document for ShardingsphereDriverURLProvider spi (#24203)
2b2c8a93643 is described below

commit 2b2c8a9364369f741f9968ed64543862bf8a4367
Author: Guocheng Tang <to...@apache.org>
AuthorDate: Fri Feb 17 00:52:29 2023 +0800

    Add document for ShardingsphereDriverURLProvider spi (#24203)
    
    * add document for ShardingsphereDriverURLProvider spi
    
    * remove dot
---
 docs/document/content/dev-manual/data-source.cn.md    | 17 +++++++++++++++++
 docs/document/content/dev-manual/data-source.en.md    | 17 +++++++++++++++++
 .../user-manual/error-code/sql-error-code.cn.md       | 19 ++++++++++---------
 .../user-manual/error-code/sql-error-code.en.md       | 19 ++++++++++---------
 .../core/driver/ShardingSphereDriverURLManager.java   |  2 +-
 5 files changed, 55 insertions(+), 19 deletions(-)

diff --git a/docs/document/content/dev-manual/data-source.cn.md b/docs/document/content/dev-manual/data-source.cn.md
index 850485a1085..3855c1d2799 100644
--- a/docs/document/content/dev-manual/data-source.cn.md
+++ b/docs/document/content/dev-manual/data-source.cn.md
@@ -100,3 +100,20 @@ chapter = true
 | ---------------------------------- | ------------------------- | ---------- |
 | Default                            | 默认数据源连接池活跃探测器     | [`org.apache.shardingsphere.infra.datasource.pool.destroyer.detector.type.DefaultDataSourcePoolActiveDetector`](https://github.com/apache/shardingsphere/blob/master/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/type/DefaultDataSourcePoolActiveDetector.java) |
 | com.zaxxer.hikari.HikariDataSource | Hikari 数据源连接池活跃探测器 | [`org.apache.shardingsphere.infra.datasource.pool.destroyer.detector.type.HikariDataSourcePoolActiveDetector`](https://github.com/apache/shardingsphere/blob/master/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/type/HikariDataSourcePoolActiveDetector.java) |
+
+## ShardingsphereDriverURLProvider
+
+### 全限定类名
+
+[`org.apache.shardingsphere.infra.datasource.pool.destroyer.detector.DataSourcePoolActiveDetector`](https://github.com/apache/shardingsphere/blob/master/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/DataSourcePoolActiveDetector.java)
+
+### 定义
+
+ShardingSphere 驱动 URL 提供器
+
+### 已知实现
+
+| *配置标识*                                  | *详细说明*     | *全限定类名*                                                                                                                                                                                                                                                        |
+|-----------------------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| jdbc:shardingsphere:classpath:<path>    | 驱动的类路径加载器  | [`org.apache.shardingsphere.driver.jdbc.core.driver.spi.ClasspathDriverURLProvider`](https://github.com/apache/shardingsphere/blob/master/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/ClasspathDriverURLProvider.java)       |
+| jdbc:shardingsphere:absolutepath:<path> | 驱动的绝对路径加载器 | [`org.apache.shardingsphere.driver.jdbc.core.driver.spi.AbsolutePathDriverURLProvider`](https://github.com/apache/shardingsphere/blob/master/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/AbsolutePathDriverURLProvider.java) |
diff --git a/docs/document/content/dev-manual/data-source.en.md b/docs/document/content/dev-manual/data-source.en.md
index 693ec150f5f..0c72fe8c6f7 100644
--- a/docs/document/content/dev-manual/data-source.en.md
+++ b/docs/document/content/dev-manual/data-source.en.md
@@ -83,3 +83,20 @@ Data source connection pool active detector
 | ---------------------------------- | ---------------------------------------- | ---------------------------- |
 | Default                            | Default data source pool active detector | [`org.apache.shardingsphere.infra.datasource.pool.destroyer.detector.type.DefaultDataSourcePoolActiveDetector`](https://github.com/apache/shardingsphere/blob/master/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/type/DefaultDataSourcePoolActiveDetector.java) |
 | com.zaxxer.hikari.HikariDataSource | Hikari data source pool active detector  | [`org.apache.shardingsphere.infra.datasource.pool.destroyer.detector.type.HikariDataSourcePoolActiveDetector`](https://github.com/apache/shardingsphere/blob/master/infra/common/src/main/java/org/apache/shardingsphere/infra/datasource/pool/destroyer/detector/type/HikariDataSourcePoolActiveDetector.java) |
+
+## ShardingsphereDriverURLProvider
+
+### Fully-qualified class name
+
+[`org.apache.shardingsphere.driver.jdbc.core.driver.ShardingSphereDriverURLProvider`](https://github.com/apache/shardingsphere/blob/master/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/ShardingsphereDriverURLProvider.java)
+
+### Definition
+
+ShardingSphere driver URL provider
+
+### Implementation classes
+
+| *Configuration Type*                    | *Description*                         | *Fully-qualified class name* |
+|-----------------------------------------|---------------------------------------| ---------------------------- |
+| jdbc:shardingsphere:classpath:<path>    | The classpath driver URL provider     | [`org.apache.shardingsphere.driver.jdbc.core.driver.spi.ClasspathDriverURLProvider`](https://github.com/apache/shardingsphere/blob/master/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/ClasspathDriverURLProvider.java) |
+| jdbc:shardingsphere:absolutepath:<path> | The absolute path driver URL provider | [`org.apache.shardingsphere.driver.jdbc.core.driver.spi.AbsolutePathDriverURLProvider`](https://github.com/apache/shardingsphere/blob/master/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/AbsolutePathDriverURLProvider.java) |
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.cn.md b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
index 0110649ab19..ad9cf82d337 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.cn.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
@@ -35,15 +35,16 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
 
 ### 语法
 
-| SQL State | Vendor Code | 错误信息 |
-| --------- | ----------- | ------ |
-| 42000     | 12000       | You have an error in your SQL syntax: %s |
-| 42000     | 12001       | Can not accept SQL type \`%s\`. |
-| 42000     | 12002       | SQL String can not be NULL or empty. |
-| 42000     | 12010       | Can not support variable \`%s\`. |
-| 42S02     | 12011       | Can not find column label \`%s\`. |
-| HV008     | 12020       | Column index \`%d\` is out of range. |
-| 0A000     | 12100       | DROP TABLE ... CASCADE is not supported. |
+| SQL State | Vendor Code | 错误信息                                         |
+| --------- | ----------- |----------------------------------------------|
+| 42000     | 12000       | You have an error in your SQL syntax: %s     |
+| 42000     | 12001       | Can not accept SQL type \`%s\`.              |
+| 42000     | 12002       | SQL String can not be NULL or empty.         |
+| 42000     | 12010       | Can not support variable \`%s\`.             |
+| 42S02     | 12011       | Can not find column label \`%s\`.            |
+| 42S02     | 12012       | Can not find driver url provider for \`%s`\. |
+| HV008     | 12020       | Column index \`%d\` is out of range.         |
+| 0A000     | 12100       | DROP TABLE ... CASCADE is not supported.     |
 
 ### 连接
 
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.en.md b/docs/document/content/user-manual/error-code/sql-error-code.en.md
index 24968d21070..7ba9c53a34a 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.en.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.en.md
@@ -35,15 +35,16 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
 
 ### Syntax
 
-| SQL State | Vendor Code | Reason |
-| --------- | ----------- | ------ |
-| 42000     | 12000       | You have an error in your SQL syntax: %s |
-| 42000     | 12001       | Can not accept SQL type \`%s\`. |
-| 42000     | 12002       | SQL String can not be NULL or empty. |
-| 42000     | 12010       | Can not support variable \`%s\`. |
-| 42S02     | 12011       | Can not find column label \`%s\`. |
-| HV008     | 12020       | Column index \`%d\` is out of range. |
-| 0A000     | 12100       | DROP TABLE ... CASCADE is not supported. |
+| SQL State | Vendor Code | Reason                                       |
+| --------- |-------------|----------------------------------------------|
+| 42000     | 12000       | You have an error in your SQL syntax: %s     |
+| 42000     | 12001       | Can not accept SQL type \`%s\`.              |
+| 42000     | 12002       | SQL String can not be NULL or empty.         |
+| 42000     | 12010       | Can not support variable \`%s\`.             |
+| 42S02     | 12011       | Can not find column label \`%s\`.            |
+| 42S02     | 12012       | Can not find driver url provider for \`%s`\. |
+| HV008     | 12020       | Column index \`%d\` is out of range.         |
+| 0A000     | 12100       | DROP TABLE ... CASCADE is not supported.     |
 
 ### Connection
 
diff --git a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/ShardingSphereDriverURLManager.java b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/ShardingSphereDriverURLManager.java
index 1ebfefdcaf9..3d775277b7b 100644
--- a/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/ShardingSphereDriverURLManager.java
+++ b/jdbc/core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/driver/ShardingSphereDriverURLManager.java
@@ -37,6 +37,6 @@ public final class ShardingSphereDriverURLManager {
                 return each.getContent(url);
             }
         }
-        throw new DriverURLProviderNotFoundException("No suitable driver url provider for " + url);
+        throw new DriverURLProviderNotFoundException(url);
     }
 }