title: How can I get different datatypes from ResultSetMetaData in Java?
body: <p>I have a ResultSet that returns data of different types. The query is constructed dynamically so, at compile time, I don't know what type of value the query will return.</p>
  
  <p>I have written the following code assuming that all results are Strings. But I want to get the type of each value too. How can I do this?</p>
  
  <p>Below is the code I have written.</p>
  
  <pre><code>while (reportTable_rst.next()) {
      String column = reportTable_rst.getString(columnIterator);
  }
  </code></pre>
  
  <p>At this point, I would like to get the column type, and get the value according to the data type.</p>