title: How to get result from Result Set using getObject method?
body: <p>I'm trying to get the result of my Result Set where I register my 2nd parameter as <code>INTEGER</code>. From what I read I should get the object first before retrieving it using Result Set.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>try (Connection myConn = DBUtil.connect();
               CallableStatement myFirstCs = myConn.prepareCall("{call getSECTION_NAME(?,?)}"))
          {
               myFirstCs.setString(1, searchSection);
               myFirstCs.registerOutParameter(2, Types.INTEGER);
               myFirstCs.executeUpdate();
  
               String name = null;
  
               System.out.println(myFirstCs.getObject(2));
  
              ResultSet myRs = null;
              myRs = (java.sql.ResultSet)myFirstCs.getObject(2);
              while (myRs.next()) // Retrieve result set rows
              {                  
                  name=myRs.getString(1);
                  System.out.print("Section Name: "+name);
              }
              myRs.close(); 
  </code></pre>
  
  <p>Is this the proper way retrieving Result Set? I try this method using try with resource. I missed something here <code>ResultSet myRs = myFirstCs.getObject(2, type)</code> don't know what will I put in my 2nd parameter?</p>
  
  <p><strong>Sample Only</strong></p>
  
  <pre><code>try (ResultSet myRs = myFirstCs.getObject(2, type))//What should I put here?
                {
                    while (myRs.next())
                    {
                        name = myRs.getString(1);
                        System.out.print("Section Name: "+name);
                    }//end of while
                }
  </code></pre>
  
  <p>Feel free to comment. Any help would appreciate. Thank you.</p>