This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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!