support for datetimeoffset
Brought to you by:
ickzon
JTDS currently doesn't support datetimeoffset datatype introduced in MSSQL 2008.
Shortened stacktrace when calling ResultSet.getTimestamp(int) is:
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] at java.sql.Timestamp.valueOf(Timestamp.java:249) at net.sourceforge.jtds.jdbc.Support.convert(Support.java:480) at net.sourceforge.jtds.jdbc.JtdsResultSet.getTimestamp(JtdsResultSet.java:1163) at net.sourceforge.jtds.jdbc.JtdsResultSet.getTimestamp(JtdsResultSet.java:1315)
keywords: locale date time datetime offset datetimeoffset timezone
Discussion: Support for datetimeoffset in SQLServer
Discussion: JTDS support for MSSQL2008 datetimeoffset
Additional info to think about regarding the possible implementation of datetimeoffset is mentioned in forum https://sourceforge.net/p/jtds/discussion/104389/thread/99808c0f/#d94b:
Handling datetimeoffset datatype gained importance especially when working with SQL Server as a Microsoft Azure cloud service. Note from MSDN: "These uses for DateTimeOffset values are much more common than those for DateTime values. As a result, DateTimeOffset should be considered the default date and time type for application development". Unfortunately, almost four years later, last version of driver (jTDS 1.3.1) still does not support this type of data.