JDBC offers me 3 different datatypes for time-related fields: “Date”, “Time” and “Timestamp”. Can someone provide a simple summary of what each one is used for and how to choose which to use for a given problem?
JDBC offers me 3 different datatypes for time-related fields: Date, Time and Timestamp. Can
Share
Let’s assume you have the date/time January 1, 2003 2:00pm stored in a database column. The three options are used as follows:
Use Date if you are only interested in the date portion of the date string.
Use Time if you are only interested in the time portion of the date string
Use Timestamp if you want the date and time of the date string