wood burning stoves 2.0
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 REST with Spring (video course) this week in the Spring 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
Consider Paul's rocket mass heater.
subject: java.sql.Date
It's not a secret anymore!