aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes URGENT!!! Date class in java.sql and java.util packages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "URGENT!!! Date class in java.sql and java.util packages" Watch "URGENT!!! Date class in java.sql and java.util packages" New topic
Author

URGENT!!! Date class in java.sql and java.util packages

amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231

Hi everybody,

This is urgent!!! Why is there a Date class in java.sql package which extends Date class in java.util package?
Thanks in advance to anybody answers this question.
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
When in doubt go to the API and look up the Date class. Here is what the API says:

A thin wrapper around a millisecond value that allows JDBC to identify this as a SQL DATE. A milliseconds value represents the
number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT.
To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be 'normalized' by setting the hours, minutes, seconds, and milliseconds to zero in the particular time zone with which the instance is associated.

Bill
amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231

Thanks Bill,
But I cannot understand these statements in API. Please Help!!!
 
Consider Paul's rocket mass heater.
 
subject: URGENT!!! Date class in java.sql and java.util packages