title: How to convert Oracle "TIME" to JDBC Time in query?
body: <p>Oracle doesn't support the TIME datatype, but you can use DATE to store a TIME.</p>
  
  <p>My problem:</p>
  
  <pre><code>select to_date('2009-06-30', 'YYYY-MM-DD') as "DATE",
         to_date('16:31:59', 'HH24:MI:SS') as "TIME"
  from dual
  </code></pre>
  
  <p>yields:</p>
  
  <pre><code>DATE        TIME
  2009-06-30  2009-08-01
  </code></pre>
  
  <p>when I run it through JDBC (in SQuirrel SQL, in fact). "2009-08-01" isn't a very useful time. In my code, I can use <code>ResultSet.getTime()</code>. But how can I get the time in a generic query? Is there a way to cast the result?</p>