aspose file tools*
The moose likes Beginning Java and the fly likes Column type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Column type" Watch "Column type" New topic

Column type

Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
Hi friends,
I have a date column and it's type is Date. Do I need to have "SimpleDateFormat" in my program to format my date as well or not?

Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
That really depends on what you want to do with that Date object. The Date class has a toString() method which displays the date it contains, but you can't modify how this date if formatted using only the Date class. If you want to format it to a specific user's taste or to some general format of your own, you'll have to use the SimpleDateFormat class. However, if you don't need to display it in any special way, you won't need that class.

SCJP Tipline, etc.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Column type
Similar Threads
dynamic column names and it's values
weblogic jdbc, problem while retrieving date object.
Date or Timestamp?
Help with Date conversion from PostgreSQL database
How to get dates to ActionForm in Struts