Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field index to DataTruncation [JDBC405] #446

Closed
firebird-issue-importer opened this issue Sep 8, 2015 · 5 comments
Closed

Add field index to DataTruncation [JDBC405] #446

firebird-issue-importer opened this issue Sep 8, 2015 · 5 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Sep 8, 2015

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.

Thanks

Commits: 48257e8

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 8, 2015

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).

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 18, 2016

Modified by: @mrotteveel

Fix Version: Jaybird 3.0 [ 10440 ]

summary: Add field name to DataTruncation => Add field index to DataTruncation

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 18, 2016

Commented by: @mrotteveel

Added field index to the DataTruncation exception.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 18, 2016

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 7, 2017

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants