-
Couldn't load subscription status.
- Fork 442
PreparedStatement.executeBatch() Throws BatchUpdateException "Unable to retrieve column metadata." When Insert SQL Column Name Case Does Not Match Table #2695
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
Conversation
- Add test case for matching column case in batch execution - Add test case for mismatched column case in batch execution, expected SQLServerException
- Update column index search to be case-insensitive in SQLServerPreparedStatement - Remove failing test case in BatchExecutionTest that was checking for specific exception
- Add getIsCaseSensitive() method to SQLCollation class - Update SQLServerPreparedStatement to use case sensitivity information - Improve performance by avoiding unnecessary case-insensitive comparisons
- Add support for case-sensitive column names in SQLServerBulkBatchInsertRecord - Update SQLServerBulkRecord to handle case sensitivity in column metadata - Modify SQLServerPreparedStatement to pass case sensitivity information to batch records - Add tests for case-sensitive and case-insensitive column name handling in batch execution
…port in BatchExecutionTest
…abase in unit test.
- Return false (case-insensitive) if sortOrder is not found
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2695 +/- ##
============================================
+ Coverage 51.67% 51.89% +0.21%
- Complexity 4011 4054 +43
============================================
Files 147 147
Lines 33759 33828 +69
Branches 5640 5655 +15
============================================
+ Hits 17445 17554 +109
+ Misses 13861 13820 -41
- Partials 2453 2454 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Issue Description
When using executeBatch() to insert data, if the names of the columns in SQL statement do not match the case (uppercase/lowercase) of the actual column names in the database, the driver throws a BatchUpdateException with the message "Unable to retrieve column metadata."
GitHub Issue : [BUG] PreparedStatement.executeBatch() When the Insert Sql Column Name Case Mismatch, Throws BatchUpdateException "Unable to retrieve column metadata."
Note: This PR incorporates the community-contributed changes from PR: #2589.