aspose file tools*
The moose likes JDBC and the fly likes problem retrieving  datetime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem retrieving  datetime" Watch "problem retrieving  datetime" New topic
Author

problem retrieving datetime

kesava chaitanya
Greenhorn

Joined: Aug 20, 2001
Posts: 28
hi

how to retrieve datetime with result;
if i use rs.getDate("CREATE_DATE") i am getting numberformat exception?i am using oracle database?
i want in this format 12-Jul-2003 14:20 format???
can anybody give me code
SELECT TO_CHAR(CREATE_DATE, 'DD-MON-YYYY HH24:MI') AS CREATE_DATE FROM COMPLAINT_DETAILS A,COMPLAINT_MASTER B, OFFICE_HIRARCHY C,CONSUMER_MASTER D,USER_MASTER E WHERE RECORD_STATUS='ACTIVE'
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
replace "TO_CHAR(CREATE_DATE, 'DD-MON-YYYY HH24:MI') AS CREATE_DATE " with "CREATE_DATE"
Paulo Salgado
Ranch Hand

Joined: Jan 18, 2002
Posts: 98
Another option would be to use rs.getString("CREATE_DATE") instead of rs.getDate("CREATE_DATE"), as the TO_CHAR function probably returns a String.
-Paulo
[ July 25, 2003: Message edited by: Paulo Salgado ]
[ July 25, 2003: Message edited by: Paulo Salgado ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem retrieving datetime