apache / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
19.88k stars 6.73k forks source link

SqlServer uses setNString #32314

Open yeapornope opened 2 months ago

yeapornope commented 2 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 2 months ago

The sharding mode used is shardingsphere-JDBC

terrymanu commented 2 months ago

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

yeapornope commented 2 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 2 months ago

Looking forward to your reply, thank you