apache / apache/shardingsphere
SqlServer uses setNString
- Dominant language
- Java
- Stars
- 20.8k
- Forks
- 6.9k
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 326
Description
shardingsphere version : 5.3.2
SQL SERVER VERSION: 2017
Data of the NVARCHAR data type cannot be written properly when using shardingsphere
Through the code can be found in the AbstractUnsupportedOperationPreparedStatement setNString has been write die throw an exception
The question is:
1. Is there an extended way to set setNString properly

2. Current I have through the TypeHandler setNString method will be replaced by setString method, can write, but for business reason sendStringParametersAsUnicode = false must adjust to false, Therefore, the correct information cannot be obtained when the sql query is used, and the Chinese data is written as???? Therefore, you want to change the way to implement NVARCHAR

Want to ask whether there are other processing methods in the latest version, please prompt
Contributor guide
Research direction
Start by inspecting AbstractUnsupportedOperationPreparedStatement#setNString and the TypeHandler setNString path described in the report, then reproduce the behavior against SQL Server 2017 with NVARCHAR data. Done means identifying a supported handling path that preserves Chinese text on writes and allows correct query results without relying on the reported setString workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100