This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.sql.Date" Watch "java.sql.Date" New topic
Author

java.sql.Date

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
format
Could anyone pls tell me another way ?
Thanks in advanced
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
new java.text.SimpleDateFormat("MM/dd/yyyy").format(date);
- Peter
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: java.sql.Date
 
jQuery in Action, 3rd edition