title: coding of java mysql to retrieve data using hashmap and while loop
body: <p>I don't know how to retrieve data using hashmap and while loop from my database. plz help me.<br>
  My code is</p>
  
  <pre><code>    package com.glomindz.mercuri.dao;
  
      import java.sql.Connection;
      import java.sql.PreparedStatement;
      import java.sql.ResultSet;
      import java.sql.SQLException;
      import java.util.HashMap;
  
      import com.glomindz.mercuri.util.MySingleTon;
  
            public class UserServicesDAO {
  
  private Connection connection;
  
  public UserServicesDAO() {
      //connection = new MySingleTon().getConnection();
      connection = MySingleTon.getInstance().getConnection();
  
  }
  
  public void get_all_data() {
      HashMap&lt;Integer, String&gt; result = new HashMap&lt;Integer, String&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());
  
      } catch (SQLException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  }
  
  public static void main(String[] args) {
      new UserServicesDAO().get_all_data();
  }
   }
  </code></pre>
  
  <p>What's wrong with the code?</p>