Hisoka-X commented on code in PR #7261:
URL: https://github.com/apache/seatunnel/pull/7261#discussion_r1756460758


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java:
##########
@@ -528,6 +573,17 @@ protected List<String> queryString(String url, String sql, 
ResultSetConsumer<Str
         }
     }
 
+    protected boolean querySQLResultExists(String dbUrl, String sql) {
+        try (PreparedStatement stmt = 
getConnection(dbUrl).prepareStatement(sql)) {
+            try (ResultSet rs = stmt.executeQuery()) {
+                return rs.next();
+            }
+        } catch (Exception e) {
+            log.info("query exists error", e);
+            return false;

Review Comment:
   Why we should catch all exception we query failed? This is a mistake.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to