Add field index to DataTruncation [JDBC405] #446
Submitted by: Felipe Jaekel (fkj)
I'd like to suggest the addition of the field name on the message of the java.sql.DataTruncation that is thrown from FBWorkaroundStringField.java:78, since it would make easier to track where the problem happened on tables with a lot of string fields.
The text was updated successfully, but these errors were encountered:
Commented by: @mrotteveel
We currently use the default java.sql.DataTruncation exception class which doesn't have support for custom messages (except by subclassing and overriding getMessage, which I'd prefer not to do). java.sql.DataTruncation does have support for reporting the index of the field, but we currently don't have the column index information available there, and making that info available will take some work.
I will park this for now, if I am going to change this, then likely that will be in Jaybird 3.0 or later.
As a 'workaround': the stacktrace does provide you where in your code the setString was called, and that should allow you to pinpoint the offending column (assuming you have compiled your own code with linenumber information).