 <p>Here is the User class you may need, modify it as per your need:</p> <pre><code>public class User { private int id; private String Name; private String email; private String mobile; private String password; private String role; private String status; private String last_update; public String getName() { return Name; } public void setName(String name) { Name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getLast_update() { return last_update; } public void setLast_update(String last_update) { this.last_update = last_update; } public int getId() { return id; } public void setId(int id) { this.id = id; } @Override public String toString() { return "User [id=" + id + ", Name=" + Name + ", email=" + email + ", mobile=" + mobile + ", password=" + password + ", role=" + role + ", status=" + status + ", last_update=" + last_update + "]"; } } </code></pre> <p>Further in your JDBC code, you will need to create a collection of your User class objects and store the database results in it. Something like this:</p> <pre><code>List&lt;User&gt; usersList = new ArrayList&lt;User&gt;(); while (resultSet.next()) { User user = new User(); user.setId(resultSet.getInt("id")); user.setName(resultSet.getString("name")); user.setEmail(resultSet.getString("email")); user.setMobile(resultSet.getString("mobile")); user.setPassword(resultSet.getString("password")); user.setRole(resultSet.getString("role")); user.setStatus(resultSet.getString("status")); user.setLast_udpate(resultSet.getString("last_update")); // print the results System.out.println(user); usersList.add(user); } </code></pre>