【修改】删除数据库判空

This commit is contained in:
YOHO\20373
2025-06-27 12:07:05 +08:00
parent 3f17230b15
commit a370e6acd5

View File

@@ -1009,7 +1009,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
try (Connection connstu = DriverManager.getConnection(stuDbUrl, user, password);
Statement stmtstu = connstu.createStatement()) {
if (tNames!=null&&tNames.size()>0){
for (String tName : tNames) {
// 校验数据库名格式,防止 SQL 注入
if (!tName.matches("^[a-zA-Z0-9_]+$")) {
@@ -1029,7 +1029,7 @@ public class IMysqlLocalServiceImpl implements IMysqlLocalService {
}
}
}
}
} catch (SQLException e) {
e.printStackTrace();
throw new RuntimeException("数据库操作失败", e);