MSSQL data type DATETIME2 (DATETIME in older versions) map best to a java.sql.Timestamp.
The MSSQL TIMESTAMP data type does not represent a date and should not be used with setTimestamp() or with java.sql.Timestamp. To store dates in MSSQL use the TIME, DATE, or DATETIME2 (replaces DATETIME in newer versions) data types.
See this link regarding the Microsoft Sql Server TIMESTAMP data type (replaced/renamed with/by ROWVERSION in later versions):
A couple things to point out from the link above.
First, in the definition it includes:
"The rowversion data type is just an incrementing number and does not preserve a date or a time."
Next it has this note:
The timestamp syntax is deprecated. This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
A note regarding MySQL: MySQL has a TIMESTAMP data type that does store a date time. MySql TIMESTAMP stores all dates in the database as UTC. It will convert all dates between the servers time zone and UTC so be cautious about changing the servers timezone. Also be aware that it can be configured to behave in a magical way (automatically update on inserts and updates to any field in the record). https://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html