diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/ResourceDao.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/ResourceDao.java index b47971e1f0..c9ff149306 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/ResourceDao.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/ResourceDao.java @@ -18,6 +18,7 @@ package org.apache.dolphinscheduler.dao.upgrade; import org.apache.dolphinscheduler.common.utils.ConnectionUtils; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,11 +36,12 @@ public class ResourceDao { /** * list all resources + * * @param conn connection * @return map that key is full_name and value is id */ - Map listAllResources(Connection conn){ - Map resourceMap = new HashMap<>(); + Map listAllResources(Connection conn) { + Map resourceMap = new HashMap<>(); String sql = String.format("SELECT id,full_name FROM t_ds_resources"); ResultSet rs = null; @@ -48,14 +50,14 @@ public class ResourceDao { pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); - while (rs.next()){ + while (rs.next()) { Integer id = rs.getInt(1); String fullName = rs.getString(2); - resourceMap.put(fullName,id); + resourceMap.put(fullName, id); } } catch (Exception e) { - logger.error(e.getMessage(),e); + logger.error(e.getMessage(), e); throw new RuntimeException("sql: " + sql, e); } finally { ConnectionUtils.releaseResource(rs, pstmt, conn);