As we have two date classes: java.sql.Date and java.util.Date. Whats the reason ResultSet#getDate() returns the sql.Date not util.Date?
Agreed that sql.Date extends util.Date. But whats the reason of creating new class altogether when most of the methods in both the classes looks same?
As we have two date classes: java.sql.Date and java.util.Date . Whats the reason ResultSet#getDate()
Share
The reason is right in the JavaDocs of
java.sql.Date:So a
java.util.Datehas a “time” part, whereas in ajava.sql.Datethe time is always “zero” because the (ANSI) SQLDATEdata type does not have a time either.