File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes java.sql.Date 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 "java.sql.Date" Watch "java.sql.Date" New topic


lu v thuan
Ranch Hand

Joined: Oct 25, 2001
Posts: 32
Hi friends
I have a Date field in Oracle. I use JDBC to get that field.
I would like to display the format like this :mm/dd/yyyy
but in java I can display as :yyyy-mm-dd
I tried to used getMonth(),getDate,getYear() to get the desired
Could anyone pls tell me another way ?
Thanks in advanced
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
new java.text.SimpleDateFormat("MM/dd/yyyy").format(date);
- Peter
I agree. Here's the link:
subject: java.sql.Date
It's not a secret anymore!