title: JDBC ResultSet: I need a getDateTime, but there is only getDate and getTimeStamp
body: <p>I would like to get the DATETIME column from an Oracle DB Table with JDBC. Here is my code:</p>
  <pre><code>int columnType = rsmd.getColumnType(i);
  if(columnType == Types.DATE)
  {
      Date aDate = rs.getDate(i);
      valueToInsert = aDate.toString();
  }
  else if(columnType == Types.TIMESTAMP)
  {
      Timestamp aTimeStamp = rs.getTimestamp(i);
      valueToInsert = aTimeStamp.toString();
  }
  else
  {
      valueToInsert = rs.getString(i);
  }
  </code></pre>
  <p>I have to identify the column type first. The field I am interested in is recognized as a Types.DATE, but it is really a DATETIME in the DB since it has this format: &quot;07.05.2009 13:49:32&quot;</p>
  <p>getDate truncates the time: &quot;07.05.2009&quot;
  and getString appends &quot;.0&quot; to it: &quot;07.05.2009 13:49:32.0&quot;</p>
  <p>Of course I could just remove the final .0 and work with getString all the time, but it is a dirty workaround.</p>
  <p>Any ideas? I was looking for a getDateTime method.</p>