title: How to convert ResultSet object to one specific POJO class object?
body: <ol>
  <li><p>For example i have a Resultset which contain Details about Employee details and I have a table For Employee in database and i am selecting all details from that</p></li>
  <li><p>I have java POJO class which resembles Employee Table what is the best method to implement convert result set into Employee class object </p></li>
  <li><p>what is the best way to implement if i have multiple classes Like Employee and multiple tables too how to write a reusable code.</p></li>
  </ol>
  
  <p>I am Using following notation now.</p>
  
  <pre><code>public Employee{
  
      private int empId;
  
      public setEmpId(int empId){
          this.empId = empId;
      }
  
      public int getEmpId(){
          return this.empId;
      }
  }
  
  public class SetResultSetToEmployee{
  
      public Employee getEmployee(){
          Employee e = new Employee();
          e.setEmpId(resultSet.getInt("EmpId"));
          return e;
      }
  }
  </code></pre>