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 06cfbce3d2e Refactor ConnectionSQLException (#30782)
06cfbce3d2e is described below
commit 06cfbce3d2e3180f1fce5b2f2d35fcba87936d3e
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Apr 5 21:39:13 2024 +0800
Refactor ConnectionSQLException (#30782)
---
.../user-manual/error-code/sql-error-code.cn.md | 18 +++++++++---------
.../user-manual/error-code/sql-error-code.en.md | 18 +++++++++---------
.../sharding/auditor/ShardingSQLAuditorTest.java | 3 +--
.../exception/connection/CircuitBreakException.java | 2 +-
.../OverallConnectionNotEnoughException.java | 2 +-
.../connection/SQLExecutionInterruptedException.java | 2 +-
.../database/resource/node/StorageNodeAggregator.java | 2 +-
.../resource/unit/StorageUnitNodeMapCreator.java | 2 +-
.../core/connector/url/StandardJdbcUrlParser.java | 1 +
.../core/exception/ConnectionURLException.java | 18 +++++++-----------
.../UnrecognizedDatabaseURLException.java | 5 ++---
.../UnsupportedStorageTypeException.java | 6 +++---
.../infra/database/core/type/DatabaseTypeFactory.java | 1 +
.../core/connector/url/StandardJdbcUrlParserTest.java | 1 +
.../database/core/type/DatabaseTypeFactoryTest.java | 1 +
.../h2/connector/H2ConnectionPropertiesParser.java | 2 +-
.../connector/MySQLConnectionPropertiesParserTest.java | 2 +-
.../OpenGaussConnectionPropertiesParserTest.java | 2 +-
.../connector/OracleConnectionPropertiesParser.java | 2 +-
.../OracleConnectionPropertiesParserTest.java | 2 +-
.../PostgreSQLConnectionPropertiesParserTest.java | 2 +-
.../connector/SQL92ConnectionPropertiesParser.java | 2 +-
.../connector/SQL92ConnectionPropertiesParserTest.java | 2 +-
.../connector/SQLServerConnectionPropertiesParser.java | 2 +-
.../SQLServerConnectionPropertiesParserTest.java | 2 +-
.../driver/exception/DriverConnectionException.java | 2 +-
.../database/exception/DatetimeLoadingException.java | 2 +-
27 files changed, 52 insertions(+), 54 deletions(-)
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 83e3d2dced5..33786a21731 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
@@ -70,15 +70,15 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| Vendor Code | SQL State | 错误信息
|
|-------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| 13000 | 0A000 | Unsupported storage type of URL '%s'.
|
-| 13001 | 08000 | The URL '%s' is not recognized, please refer to
the pattern '%s'.
|
-| 13010 | 08000 | Can not get %d connections one time, partition
succeed connection(%d) have released. Please consider increasing the
\`maxPoolSize\` of the data sources or decreasing the
\`max-connections-size-per-query\` in properties. |
-| 13011 | 08000 | SQL execution has been interrupted.
|
-| 13030 | 01000 | Circuit break open, the request has been ignored.
|
-| 13040 | HY000 | Load datetime from database failed, reason: %s
|
-| 13100 | 08000 | Can not register driver.
|
-| 13101 | 08000 | Connection has been closed.
|
-| 13102 | 08000 | Result set has been closed.
|
+| 13000 | 08000 | Can not get %d connections one time, partition
succeed connection(%d) have released. Please consider increasing the
\`maxPoolSize\` of the data sources or decreasing the
\`max-connections-size-per-query\` in properties. |
+| 13001 | 08000 | SQL execution has been interrupted.
|
+| 13010 | 01000 | Circuit break open, the request has been ignored.
|
+| 13100 | 0A000 | Unsupported storage type of URL '%s'.
|
+| 13101 | 08000 | The URL '%s' is not recognized, please refer to
the pattern '%s'.
|
+| 13200 | 08000 | Can not register driver.
|
+| 13201 | 08000 | Connection has been closed.
|
+| 13202 | 08000 | Result set has been closed.
|
+| 13400 | HY000 | Load datetime from database failed, reason: %s
|
### 事务
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 66933f65737..e5fed060234 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
@@ -71,15 +71,15 @@ SQL error codes provide by standard `SQL State`, `Vendor
Code` and `Reason`, whi
| Vendor Code | SQL State | Reason
|
|-------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| 13000 | 0A000 | Unsupported storage type of URL '%s'.
|
-| 13001 | 08000 | The URL '%s' is not recognized, please refer to
the pattern '%s'.
|
-| 13010 | 08000 | Can not get %d connections one time, partition
succeed connection(%d) have released. Please consider increasing the
\`maxPoolSize\` of the data sources or decreasing the
\`max-connections-size-per-query\` in properties. |
-| 13011 | 08000 | SQL execution has been interrupted.
|
-| 13030 | 01000 | Circuit break open, the request has been ignored.
|
-| 13040 | HY000 | Load datetime from database failed, reason: %s
|
-| 13100 | 08000 | Can not register driver.
|
-| 13101 | 08000 | Connection has been closed.
|
-| 13102 | 08000 | Result set has been closed.
|
+| 13000 | 08000 | Can not get %d connections one time, partition
succeed connection(%d) have released. Please consider increasing the
\`maxPoolSize\` of the data sources or decreasing the
\`max-connections-size-per-query\` in properties. |
+| 13001 | 08000 | SQL execution has been interrupted.
|
+| 13010 | 01000 | Circuit break open, the request has been ignored.
|
+| 13100 | 0A000 | Unsupported storage type of URL '%s'.
|
+| 13101 | 08000 | The URL '%s' is not recognized, please refer to
the pattern '%s'.
|
+| 13200 | 08000 | Can not register driver.
|
+| 13201 | 08000 | Connection has been closed.
|
+| 13202 | 08000 | Result set has been closed.
|
+| 13400 | HY000 | Load datetime from database failed, reason: %s
|
### Transaction
diff --git
a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/auditor/ShardingSQLAuditorTest.java
b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/auditor/ShardingSQLAuditorTest.java
index 07d1d21ea3e..bbb550440f6 100644
---
a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/auditor/ShardingSQLAuditorTest.java
+++
b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/auditor/ShardingSQLAuditorTest.java
@@ -97,8 +97,7 @@ class ShardingSQLAuditorTest {
void assertCheckFailed() {
ShardingAuditAlgorithm auditAlgorithm =
rule.getAuditors().get("auditor_1");
RuleMetaData globalRuleMetaData = mock(RuleMetaData.class);
- doThrow(new DMLWithoutShardingKeyException())
- .when(auditAlgorithm).check(sqlStatementContext,
Collections.emptyList(), grantee, globalRuleMetaData, databases.get("foo_db"));
+ doThrow(new
DMLWithoutShardingKeyException()).when(auditAlgorithm).check(sqlStatementContext,
Collections.emptyList(), grantee, globalRuleMetaData, databases.get("foo_db"));
DMLWithoutShardingKeyException ex =
assertThrows(DMLWithoutShardingKeyException.class,
() -> new ShardingSQLAuditor().audit(sqlStatementContext,
Collections.emptyList(), grantee, globalRuleMetaData, databases.get("foo_db"),
rule, hintValueContext));
assertThat(ex.getMessage(), is("Not allow DML operation without
sharding conditions."));
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/CircuitBreakException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/CircuitBreakException.java
index 9756fbed8d4..b95f5831909 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/CircuitBreakException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/CircuitBreakException.java
@@ -28,6 +28,6 @@ public final class CircuitBreakException extends
ConnectionSQLException {
private static final long serialVersionUID = 6339672680026286798L;
public CircuitBreakException() {
- super(XOpenSQLState.GENERAL_WARNING, 30, "Circuit break open, the
request has been ignored.");
+ super(XOpenSQLState.GENERAL_WARNING, 10, "Circuit break open, the
request has been ignored.");
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/OverallConnectionNotEnoughException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/OverallConnectionNotEnoughException.java
index 29863fb9f08..c5fa6af0d34 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/OverallConnectionNotEnoughException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/OverallConnectionNotEnoughException.java
@@ -28,7 +28,7 @@ public final class OverallConnectionNotEnoughException
extends ConnectionSQLExce
private static final long serialVersionUID = -1297088138042287804L;
public OverallConnectionNotEnoughException(final int desiredSize, final
int actualSize, final Exception cause) {
- super(XOpenSQLState.CONNECTION_EXCEPTION, 10, String.format("Can not
get %d connections one time, partition succeed connection(%d) have released. "
+ super(XOpenSQLState.CONNECTION_EXCEPTION, 0, String.format("Can not
get %d connections one time, partition succeed connection(%d) have released. "
+ "Please consider increasing the `maxPoolSize` of the data
sources or decreasing the `max-connections-size-per-query` in properties.",
desiredSize, actualSize), cause);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/SQLExecutionInterruptedException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/SQLExecutionInterruptedException.java
index 3968519707b..9e1010ecc87 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/SQLExecutionInterruptedException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/connection/SQLExecutionInterruptedException.java
@@ -28,6 +28,6 @@ public final class SQLExecutionInterruptedException extends
ConnectionSQLExcepti
private static final long serialVersionUID = 3394283296623445981L;
public SQLExecutionInterruptedException() {
- super(XOpenSQLState.CONNECTION_EXCEPTION, 11, "SQL execution has been
interrupted.");
+ super(XOpenSQLState.CONNECTION_EXCEPTION, 1, "SQL execution has been
interrupted.");
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/node/StorageNodeAggregator.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/node/StorageNodeAggregator.java
index 6872bb92a67..375263ee7d7 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/node/StorageNodeAggregator.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/node/StorageNodeAggregator.java
@@ -21,7 +21,7 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.database.core.connector.url.JdbcUrl;
import
org.apache.shardingsphere.infra.database.core.connector.url.StandardJdbcUrlParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeFactory;
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeRegistry;
import
org.apache.shardingsphere.infra.datasource.pool.props.domain.DataSourcePoolProperties;
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/unit/StorageUnitNodeMapCreator.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/unit/StorageUnitNodeMapCreator.java
index 199a573a2f2..493674467d9 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/unit/StorageUnitNodeMapCreator.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/resource/unit/StorageUnitNodeMapCreator.java
@@ -21,7 +21,7 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.database.core.connector.url.JdbcUrl;
import
org.apache.shardingsphere.infra.database.core.connector.url.StandardJdbcUrlParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeFactory;
import org.apache.shardingsphere.infra.database.core.type.DatabaseTypeRegistry;
import
org.apache.shardingsphere.infra.datasource.pool.props.domain.DataSourcePoolProperties;
diff --git
a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/connector/url/StandardJdbcUrlParser.java
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/connector/url/StandardJdbcUrlParser.java
index e8a39a24d5c..7bb591a7e4d 100644
---
a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/connector/url/StandardJdbcUrlParser.java
+++
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/connector/url/StandardJdbcUrlParser.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.infra.database.core.connector.url;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import java.util.Properties;
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/exception/DriverConnectionException.java
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/ConnectionURLException.java
similarity index 66%
copy from
jdbc/src/main/java/org/apache/shardingsphere/driver/exception/DriverConnectionException.java
copy to
infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/ConnectionURLException.java
index e6e9c0ebeb1..49a64e4f6a7 100644
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/exception/DriverConnectionException.java
+++
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/ConnectionURLException.java
@@ -15,31 +15,27 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.driver.exception;
+package org.apache.shardingsphere.infra.database.core.exception;
import com.google.common.base.Preconditions;
import
org.apache.shardingsphere.infra.exception.core.external.sql.sqlstate.SQLState;
import
org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.ConnectionSQLException;
/**
- * Driver connection exception.
+ * Connection URL exception.
*/
-public class DriverConnectionException extends ConnectionSQLException {
+public class ConnectionURLException extends ConnectionSQLException {
- private static final long serialVersionUID = -4543547821709772632L;
+ private static final long serialVersionUID = 6410735261100319966L;
- private static final int DRIVER_CODE = 1;
+ private static final int URL_CODE = 1;
- protected DriverConnectionException(final SQLState sqlState, final int
errorCode, final String reason, final Object... messageArgs) {
+ protected ConnectionURLException(final SQLState sqlState, final int
errorCode, final String reason, final Object... messageArgs) {
super(sqlState, getErrorCode(errorCode), reason, messageArgs);
}
- protected DriverConnectionException(final SQLState sqlState, final int
errorCode, final String reason, final Exception cause) {
- super(sqlState, getErrorCode(errorCode), reason, cause);
- }
-
private static int getErrorCode(final int errorCode) {
Preconditions.checkArgument(errorCode >= 0 && errorCode < 100, "The
value range of error code should be [0, 100).");
- return DRIVER_CODE * 100 + errorCode;
+ return URL_CODE * 100 + errorCode;
}
}
diff --git
a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/connector/url/UnrecognizedDatabaseURLException.java
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/UnrecognizedDatabaseURLException.java
similarity index 86%
rename from
infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/connector/url/UnrecognizedDatabaseURLException.java
rename to
infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/UnrecognizedDatabaseURLException.java
index 722fadd68af..ebf28adfdd0 100644
---
a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/connector/url/UnrecognizedDatabaseURLException.java
+++
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/UnrecognizedDatabaseURLException.java
@@ -15,15 +15,14 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.database.core.connector.url;
+package org.apache.shardingsphere.infra.database.core.exception;
import
org.apache.shardingsphere.infra.exception.core.external.sql.sqlstate.XOpenSQLState;
-import
org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.ConnectionSQLException;
/**
* Unrecognized database URL exception.
*/
-public final class UnrecognizedDatabaseURLException extends
ConnectionSQLException {
+public final class UnrecognizedDatabaseURLException extends
ConnectionURLException {
private static final long serialVersionUID = -1551117178863766353L;
diff --git
a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/UnsupportedStorageTypeException.java
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/UnsupportedStorageTypeException.java
similarity index 93%
rename from
infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/UnsupportedStorageTypeException.java
rename to
infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/UnsupportedStorageTypeException.java
index d8699f22415..7e912d4c78b 100644
---
a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/UnsupportedStorageTypeException.java
+++
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/exception/UnsupportedStorageTypeException.java
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.database.core.type;
+package org.apache.shardingsphere.infra.database.core.exception;
+import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import
org.apache.shardingsphere.infra.exception.core.external.sql.sqlstate.XOpenSQLState;
-import
org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.ConnectionSQLException;
/**
* Unsupported storage type exception. When this exception is thrown, it means
that the relevant jdbcUrl lacks the corresponding {@link DatabaseType} SPI
implementation.
@@ -47,7 +47,7 @@ import
org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.c
*
* @see org.apache.shardingsphere.infra.database.core.type.DatabaseType
*/
-public final class UnsupportedStorageTypeException extends
ConnectionSQLException {
+public final class UnsupportedStorageTypeException extends
ConnectionURLException {
private static final long serialVersionUID = 8981789100727786183L;
diff --git
a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactory.java
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactory.java
index a2f3789cb04..f9aeb9e7f53 100644
---
a/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactory.java
+++
b/infra/database/core/src/main/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactory.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.infra.database.core.type;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.infra.database.core.exception.UnsupportedStorageTypeException;
import
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
diff --git
a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/connector/url/StandardJdbcUrlParserTest.java
b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/connector/url/StandardJdbcUrlParserTest.java
index 3f907a7663e..0de0c24212e 100644
---
a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/connector/url/StandardJdbcUrlParserTest.java
+++
b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/connector/url/StandardJdbcUrlParserTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.infra.database.core.connector.url;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import org.junit.jupiter.api.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git
a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactoryTest.java
b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactoryTest.java
index 6c8a02e3e99..57df5cdabe3 100644
---
a/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactoryTest.java
+++
b/infra/database/core/src/test/java/org/apache/shardingsphere/infra/database/core/type/DatabaseTypeFactoryTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.infra.database.core.type;
+import
org.apache.shardingsphere.infra.database.core.exception.UnsupportedStorageTypeException;
import org.junit.jupiter.api.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git
a/infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/connector/H2ConnectionPropertiesParser.java
b/infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/connector/H2ConnectionPropertiesParser.java
index 2fc3050e537..b0c3b9fdf7d 100644
---
a/infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/connector/H2ConnectionPropertiesParser.java
+++
b/infra/database/type/h2/src/main/java/org/apache/shardingsphere/infra/database/h2/connector/H2ConnectionPropertiesParser.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.database.h2.connector;
import com.google.common.base.Strings;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import java.util.regex.Matcher;
diff --git
a/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/connector/MySQLConnectionPropertiesParserTest.java
b/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/connector/MySQLConnectionPropertiesParserTest.java
index 9b348051b1b..32cbe7a7ecb 100644
---
a/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/connector/MySQLConnectionPropertiesParserTest.java
+++
b/infra/database/type/mysql/src/test/java/org/apache/shardingsphere/infra/database/mysql/connector/MySQLConnectionPropertiesParserTest.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.infra.database.mysql.connector;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPILoader;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
diff --git
a/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/connector/OpenGaussConnectionPropertiesParserTest.java
b/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/connector/OpenGaussConnectionPropertiesParserTest.java
index 21b8738bd53..627ff0644f5 100644
---
a/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/connector/OpenGaussConnectionPropertiesParserTest.java
+++
b/infra/database/type/opengauss/src/test/java/org/apache/shardingsphere/infra/database/opengauss/connector/OpenGaussConnectionPropertiesParserTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.opengauss.connector;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPILoader;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
diff --git
a/infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/connector/OracleConnectionPropertiesParser.java
b/infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/connector/OracleConnectionPropertiesParser.java
index df6eed9bfb6..a759abc971f 100644
---
a/infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/connector/OracleConnectionPropertiesParser.java
+++
b/infra/database/type/oracle/src/main/java/org/apache/shardingsphere/infra/database/oracle/connector/OracleConnectionPropertiesParser.java
@@ -21,7 +21,7 @@ import com.google.common.base.Strings;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
import
org.apache.shardingsphere.infra.database.core.connector.StandardConnectionProperties;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import java.util.Arrays;
import java.util.List;
diff --git
a/infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/connector/OracleConnectionPropertiesParserTest.java
b/infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/connector/OracleConnectionPropertiesParserTest.java
index 2859a663929..c311aebf2df 100644
---
a/infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/connector/OracleConnectionPropertiesParserTest.java
+++
b/infra/database/type/oracle/src/test/java/org/apache/shardingsphere/infra/database/oracle/connector/OracleConnectionPropertiesParserTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.oracle.connector;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPILoader;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
diff --git
a/infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/connector/PostgreSQLConnectionPropertiesParserTest.java
b/infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/connector/PostgreSQLConnectionPropertiesParserTest.java
index 870a40eea54..3c8ca711908 100644
---
a/infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/connector/PostgreSQLConnectionPropertiesParserTest.java
+++
b/infra/database/type/postgresql/src/test/java/org/apache/shardingsphere/infra/database/postgresql/connector/PostgreSQLConnectionPropertiesParserTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.postgresql.connector;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPILoader;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
diff --git
a/infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/connector/SQL92ConnectionPropertiesParser.java
b/infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/connector/SQL92ConnectionPropertiesParser.java
index 9b3cf5ed941..571fe01a8cb 100644
---
a/infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/connector/SQL92ConnectionPropertiesParser.java
+++
b/infra/database/type/sql92/src/main/java/org/apache/shardingsphere/infra/database/sql92/connector/SQL92ConnectionPropertiesParser.java
@@ -20,7 +20,7 @@ package
org.apache.shardingsphere.infra.database.sql92.connector;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
import
org.apache.shardingsphere.infra.database.core.connector.StandardConnectionProperties;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import java.util.regex.Matcher;
diff --git
a/infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/connector/SQL92ConnectionPropertiesParserTest.java
b/infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/connector/SQL92ConnectionPropertiesParserTest.java
index 9446c6e67f3..8fea4d3e320 100644
---
a/infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/connector/SQL92ConnectionPropertiesParserTest.java
+++
b/infra/database/type/sql92/src/test/java/org/apache/shardingsphere/infra/database/sql92/connector/SQL92ConnectionPropertiesParserTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.sql92.connector;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPILoader;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
diff --git
a/infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/connector/SQLServerConnectionPropertiesParser.java
b/infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/connector/SQLServerConnectionPropertiesParser.java
index 8b61d3f39d0..5c0891baf8a 100644
---
a/infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/connector/SQLServerConnectionPropertiesParser.java
+++
b/infra/database/type/sqlserver/src/main/java/org/apache/shardingsphere/infra/database/sqlserver/connector/SQLServerConnectionPropertiesParser.java
@@ -21,7 +21,7 @@ import com.google.common.base.Strings;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
import
org.apache.shardingsphere.infra.database.core.connector.StandardConnectionProperties;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import java.util.regex.Matcher;
diff --git
a/infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/connector/SQLServerConnectionPropertiesParserTest.java
b/infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/connector/SQLServerConnectionPropertiesParserTest.java
index bedc120df43..ada44413127 100644
---
a/infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/connector/SQLServerConnectionPropertiesParserTest.java
+++
b/infra/database/type/sqlserver/src/test/java/org/apache/shardingsphere/infra/database/sqlserver/connector/SQLServerConnectionPropertiesParserTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.sqlserver.connector;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionPropertiesParser;
-import
org.apache.shardingsphere.infra.database.core.connector.url.UnrecognizedDatabaseURLException;
+import
org.apache.shardingsphere.infra.database.core.exception.UnrecognizedDatabaseURLException;
import
org.apache.shardingsphere.infra.database.core.connector.ConnectionProperties;
import
org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPILoader;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/exception/DriverConnectionException.java
b/jdbc/src/main/java/org/apache/shardingsphere/driver/exception/DriverConnectionException.java
index e6e9c0ebeb1..a8d0910f8c0 100644
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/exception/DriverConnectionException.java
+++
b/jdbc/src/main/java/org/apache/shardingsphere/driver/exception/DriverConnectionException.java
@@ -28,7 +28,7 @@ public class DriverConnectionException extends
ConnectionSQLException {
private static final long serialVersionUID = -4543547821709772632L;
- private static final int DRIVER_CODE = 1;
+ private static final int DRIVER_CODE = 2;
protected DriverConnectionException(final SQLState sqlState, final int
errorCode, final String reason, final Object... messageArgs) {
super(sqlState, getErrorCode(errorCode), reason, messageArgs);
diff --git
a/kernel/time-service/type/database/src/main/java/org/apache/shardingsphere/timeservice/type/database/exception/DatetimeLoadingException.java
b/kernel/time-service/type/database/src/main/java/org/apache/shardingsphere/timeservice/type/database/exception/DatetimeLoadingException.java
index 79de6008da3..e082814c830 100644
---
a/kernel/time-service/type/database/src/main/java/org/apache/shardingsphere/timeservice/type/database/exception/DatetimeLoadingException.java
+++
b/kernel/time-service/type/database/src/main/java/org/apache/shardingsphere/timeservice/type/database/exception/DatetimeLoadingException.java
@@ -30,6 +30,6 @@ public final class DatetimeLoadingException extends
ConnectionSQLException {
private static final long serialVersionUID = 7844267165522132993L;
public DatetimeLoadingException(final SQLException cause) {
- super(XOpenSQLState.GENERAL_ERROR, 40, "Load datetime from database
failed.", cause);
+ super(XOpenSQLState.GENERAL_ERROR, 400, "Load datetime from database
failed.", cause);
}
}