title: write user class in java using oop concept
body: <p>i hav written a code which has given me the output from the database  table....now i hav to write a user class using oops concept plz provide me the code.my code is</p>
  
  <pre><code>package com.glomindz.mercuri.dao;
  import java.sql.Connection;
  import java.sql.Date;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Map;
  
  import com.glomindz.mercuri.util.MySingleTon;
  
  public class UserServicesDAO {
  
  private Connection connection;
  
  public UserServicesDAO() {
      // connection = new MySingleTon().getConnection();
      connection = MySingleTon.getInstance().getConnection();
  
  }
  
  public List&lt;Map&lt;Integer, String&gt;&gt; get_all_data() {
      List&lt;Map&lt;Integer, String&gt;&gt; allRows = new ArrayList&lt;Map&lt;Integer, String&gt;&gt;();
      String query = "SELECT * FROM spl_user_master";
      try {
          PreparedStatement stmt = connection.prepareStatement(query);
          boolean execute = stmt.execute();
          System.out.println(execute);
          ResultSet resultSet = stmt.getResultSet();
          System.out.println(resultSet.getMetaData());
          while (resultSet.next()) {
              int id = resultSet.getInt("id");
              String Name = resultSet.getString("name");
              String email = resultSet.getString("email");
              String mobile = resultSet.getString("mobile");
              String password = resultSet.getString("password");
              String role = resultSet.getString("role");
              String status = resultSet.getString("status");
              String last_update = resultSet.getString("last_update");
  
              // print the results
              System.out.format("%s, %s, %s, %s, %s, %s, %s, %s\n", id, Name,
                      email, mobile, password, role, status, last_update);
          }
      } catch (SQLException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      return allRows;
  }
  
  public static void main(String[] args) {
      new UserServicesDAO().get_all_data();
  }
  }
  </code></pre>
  
  <p>my output from database is</p>
  
  <pre><code>connection created
  true
  com.mysql.jdbc.ResultSetMetaData@538773
  1, Glomindz Support, support@glomindz.com, 9854087006,          cbf91a71c11d5ec348b0c7e9b2f0055e, admin, 1, 2013-05-02 22:05:14
  2, Amarjyoti Das, amarjyotidas@splcare.com, 9864092598,     88f2dccb02b2a20615211e5492f85204, admin, 1, 2013-04-26 05:44:41
  </code></pre>