the attached patch addresses various issues in the 1.2.2 release of jTDS:
1) Time conversion with user supplied Calendars:
With default TimeZone "America/New_York", setting Timestamp 2009-03-08 02:00:00 with a UTC Calendar is converted to 2009-03-08 03:00:00 (note 03:00 instead of 02:00). This is because at that time the DST switch occurs and 02:00 in the zone America/New_York doesn't exist (01:59 -> 03:00).
The patch addresses this problem by creating DateTime instances directly upon calls such as PreparedStatement.setTimestamp(int, Timestamp, Calendar) and reading from DateTime instances directly in calls such as ResultSet.getTimestamp(int, Calendar).
2) PreparedStatement.executeBatch() ... ..executeUpdate() cause data truncation at 4000 or 8000 bytes for big sized columns under certain circumstances.
I attach the DataTruncTest.java in addition to the patch (it is included in the patch) to look at the problem more easily.
We use subversion internally. The diff has been created using the appropriate subversion command. In my environment I can apply the patch to a CVS based project. If this doesn't work here, please tell me and I'll fix it.
This patch changes some parts heavily and it is probably worth to discuss some details.
Please advice where the best place is to discuss the changes (comments here or forum or e-mail?).
Thanks and best wishes,