Issue Details (XML | Word | Printable)

Key: JDBC-405
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Felipe Jaekel
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Jaybird JDBC Driver

Add field index to DataTruncation

Created: 08/Sep/15 12:21 PM   Updated: 07/May/17 12:32 PM
Component/s: None
Affects Version/s: Jaybird 2.2.8
Fix Version/s: Jaybird 3.0.0

 Description  « Hide
I'd like to suggest the addition of the field name on the message of the java.sql.DataTruncation that is thrown from, since it would make easier to track where the problem happened on tables with a lot of string fields.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 08/Sep/15 05:35 PM
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).

Mark Rotteveel added a comment - 18/Jul/16 08:23 AM
Added field index to the DataTruncation exception.