Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 36602c3

Browse files
committed
add matches("SELECT(.*)")
1 parent 82fa71c commit 36602c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/top/mryan2005/managesysteminjava/SQLs/SQLLinker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public ResultSet executeQuery(String WhatYouNeed, String ViewOrTable) throws SQL
8282
public ResultSet runSQL(String sql) {
8383
try {
8484
Statement stmt = con.createStatement();
85-
if (stmt.execute(sql)) {
85+
if (stmt.execute(sql) && sql.matches("SELECT(.*)")) {
8686
return stmt.getResultSet();
8787
}
8888
} catch (SQLException e) {

0 commit comments

Comments
 (0)