apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.99k stars 6.75k forks source link

SqlServer uses setNString #32314

Open yeapornope opened 3 months ago

yeapornope commented 3 months ago

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 C99F5513-2D91-4537-B905-525FE13443C5
  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 222

Want to ask whether there are other processing methods in the latest version, please prompt

yeapornope commented 3 months ago

The sharding mode used is shardingsphere-JDBC

terrymanu commented 3 months ago

No plan to support for now, does any one want to do it?

yeapornope commented 3 months ago

Since the database we use is SQLSERVER, we have encountered this problem in the process of integrating shardingsphere, and we want to solve this thing Or if there is an interface that can be extended, we can extend the setNString method ourselves Because we need it for our business, so far

yeapornope commented 3 months ago

Looking forward to your reply, thank you