Untitled
public List<User> findAllUser() { List<User> resultList = new ArrayList<>(); try (Connection connection = CustomDataSource.getInstance().getConnection(); PreparedStatement ps = connection.prepareStatement(FIND_ALL_USER_SQL)) { try (ResultSet rs = ps.executeQuery()) { while (rs.next()) { resultList.add(new User(rs.getLong(1), rs.getString(2), rs.getString(3), rs.getInt(4))); } } } catch (SQLException e) { e.printStackTrace(); } return resultList; }