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