Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/808#discussion_r42575461
  
    --- Diff: 
tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
 ---
    @@ -678,29 +635,20 @@ public void dropDatabase(String databaseName) throws 
UndefinedDatabaseException
       }
     
       private Collection<String> getAllDatabaseNamesInternal(@Nullable String 
whereCondition) {
    -    Connection conn = null;
    -    PreparedStatement pstmt = null;
    -    ResultSet resultSet = null;
    -
         List<String> databaseNames = new ArrayList<>();
     
    -    try {
    -      String sql = "SELECT DB_NAME FROM " + TB_DATABASES;
    +    String sql = "SELECT DB_NAME FROM " + TB_DATABASES;
     
    -      if (whereCondition != null) {
    -        sql += " WHERE " + whereCondition;
    -      }
    +    if (whereCondition != null) {
    +      sql += " WHERE " + whereCondition;
    +    }
     
    -      conn = getConnection();
    -      pstmt = conn.prepareStatement(sql);
    -      resultSet = pstmt.executeQuery();
    +    try (ResultSet resultSet = 
getConnection().prepareStatement(sql).executeQuery()) {
    --- End diff --
    
    PreparedStatement is not closed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to