iamhucong commented on code in PR #31377:
URL: https://github.com/apache/shardingsphere/pull/31377#discussion_r1613308754


##########
mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java:
##########
@@ -122,7 +122,17 @@ public List<String> getChildrenKeys(final String key) {
     
     @Override
     public boolean isExisted(final String key) {
-        return !Strings.isNullOrEmpty(query(key));
+        try (
+                Connection connection = dataSource.getConnection();
+                PreparedStatement preparedStatement = 
connection.prepareStatement(repositorySQL.getSelectByKeySQL())) {
+            preparedStatement.setString(1, key);
+            try (ResultSet resultSet = preparedStatement.executeQuery()) {
+                return resultSet.next();
+            }
+        } catch (final SQLException ex) {
+            log.error("Get {} data by key: {} failed", getType(), key, ex);

Review Comment:
   Please correct the log message.



-- 
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