question

Eran BenAri avatar image
Eran BenAri asked

working with JDBC and mix unicoded & ascii data

I'm using MSSQL 2005, connecting through JDBC driver (application in JAVA). I have a ascii and unicoded data in my database. when I worked with JDBC connection to the database, all input data become unicoded (N'xxx') by the JDBC driver. There is a JDBC parameter to turn that parameter false or true, and I have mix data in my database. In this way, the execution plans are bad and instend of index seek, there are index scan, because MSSQL do implicint convert for each row. Do you have a way to solve this issue ? Eran.
unicode
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

my main issue is that I need both ASCII and Unicode in my database, since my user input is heterogenic. If was using native SQL client, I could run queries with "N" and without, as I need. in JDBC connectivity, I don't know how to control that option per query and not for all .
0 Likes 0 ·

1 Answer

· Write an Answer
WilliamD avatar image
WilliamD answered
I suggest you make sure that the setting for unicode is the same throughout yout application and concentrate on uniformity there. Also make sure that any t-sql code that you have is written to avoid conversions between unicode and non unicode. The easiest way is to take a look at the exact queries that you have identified and clean them up, one by one. Any new development should be done with this issue in mind, so that after a few iterations, you should have removed all cases of conversions in your code.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.