The moose likes JDBC and Relational Databases and the fly likes Oracle Date/Time field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Oracle Date/Time field" Watch "Oracle Date/Time field" New topic

Oracle Date/Time field


Joined: Sep 10, 2002
Posts: 1
I need to display the TIME in jTable.
Im connecting via Oracle Thin.
My table is using a date field (e.g
The jTable only display the date but not the time.
Im stuck. Pls. help.
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
First u can retreive the date filed from date then u can apply simpledateformat and covnvert date part only.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

I have a hunch you are using the java.sql.Date toString() method which returns a String representation of the date in the format "yyyy-mm-dd".
how to work the simple date format:

Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

side note:
if your driver's getDate() function is dropping the time from your date, use the getTimestamp() method instead.
It is sorta covered in the JavaRanch Style Guide.
subject: Oracle Date/Time field
It's not a secret anymore!