From 3b3bfff2c555ac60e0c1847a714db1a8a1b972dc Mon Sep 17 00:00:00 2001 From: Odboy Date: Mon, 12 Jan 2026 20:31:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(util):=20=E4=BC=98=E5=8C=96SQL=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/odboy/system/util/KitSqlUtil.java | 10 +++++----- .../src/main/java/cn/odboy/system/util/KitSqlUtil.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cutejava-springboot3/cutejava-module-system/src/main/java/cn/odboy/system/util/KitSqlUtil.java b/cutejava-springboot3/cutejava-module-system/src/main/java/cn/odboy/system/util/KitSqlUtil.java index 4c08c8a6..63d538b5 100644 --- a/cutejava-springboot3/cutejava-module-system/src/main/java/cn/odboy/system/util/KitSqlUtil.java +++ b/cutejava-springboot3/cutejava-module-system/src/main/java/cn/odboy/system/util/KitSqlUtil.java @@ -54,12 +54,12 @@ public final class KitSqlUtil { try { className = DriverManager.getDriver(jdbcUrl.trim()).getClass().getName(); } catch (SQLException e) { - throw new BadRequestException("Get class name error: =" + jdbcUrl); + throw new BadRequestException("获取驱动类名失败,jdbcUrl=" + jdbcUrl); } if (StringUtils.isEmpty(className)) { DataTypeEnum dataTypeEnum = DataTypeEnum.urlOf(jdbcUrl); if (null == dataTypeEnum) { - throw new BadRequestException("Not supported data type: jdbcUrl=" + jdbcUrl); + throw new BadRequestException("不支持的数据库类型,jdbcUrl=" + jdbcUrl); } druidDataSource.setDriverClassName(dataTypeEnum.getDriver()); } else { @@ -82,12 +82,12 @@ public final class KitSqlUtil { try { int timeOut = 5; if (null == connection || connection.isClosed() || !connection.isValid(timeOut)) { - log.info("connection is closed or invalid, retry get connection!"); + log.info("连接已关闭或者错误,重试获取连接"); connection = dataSource.getConnection(); } } catch (Exception e) { - log.error("create connection error, jdbcUrl: {}", jdbcUrl); - throw new BadRequestException("create connection error, jdbcUrl: " + jdbcUrl); + log.error("创建连接失败, jdbcUrl={}", jdbcUrl); + throw new BadRequestException("创建连接失败, jdbcUrl=" + jdbcUrl); } finally { KitCloseUtil.close(connection); } diff --git a/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/util/KitSqlUtil.java b/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/util/KitSqlUtil.java index 4c08c8a6..63d538b5 100644 --- a/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/util/KitSqlUtil.java +++ b/cutejava/cutejava-module-system/src/main/java/cn/odboy/system/util/KitSqlUtil.java @@ -54,12 +54,12 @@ public final class KitSqlUtil { try { className = DriverManager.getDriver(jdbcUrl.trim()).getClass().getName(); } catch (SQLException e) { - throw new BadRequestException("Get class name error: =" + jdbcUrl); + throw new BadRequestException("获取驱动类名失败,jdbcUrl=" + jdbcUrl); } if (StringUtils.isEmpty(className)) { DataTypeEnum dataTypeEnum = DataTypeEnum.urlOf(jdbcUrl); if (null == dataTypeEnum) { - throw new BadRequestException("Not supported data type: jdbcUrl=" + jdbcUrl); + throw new BadRequestException("不支持的数据库类型,jdbcUrl=" + jdbcUrl); } druidDataSource.setDriverClassName(dataTypeEnum.getDriver()); } else { @@ -82,12 +82,12 @@ public final class KitSqlUtil { try { int timeOut = 5; if (null == connection || connection.isClosed() || !connection.isValid(timeOut)) { - log.info("connection is closed or invalid, retry get connection!"); + log.info("连接已关闭或者错误,重试获取连接"); connection = dataSource.getConnection(); } } catch (Exception e) { - log.error("create connection error, jdbcUrl: {}", jdbcUrl); - throw new BadRequestException("create connection error, jdbcUrl: " + jdbcUrl); + log.error("创建连接失败, jdbcUrl={}", jdbcUrl); + throw new BadRequestException("创建连接失败, jdbcUrl=" + jdbcUrl); } finally { KitCloseUtil.close(connection); }