I was so delighted for the first JDBC driver for MSSQL from M$.
(http://msdn.microsoft.com/downloads/default.asp?URL=/code/sample.asp?...)
But the happiness fades very soon after I found that the Chinese
charcter I put into
or grab from the database becomes funny characters.
I have spent a few hours decompiled and trace the JDBC driver, and found
that it
was by design ignored the possibility for retrieving non-ASCII data from
MSSQL,
it just simply convert the byte into char:
class com.microsoft.util.UtilDataConversions line 20 (as decompiled by
JAD)
stringbuffer.append((char)(abyte0[j] & 0xff));
where abyte is the raw data from SQL Server
To make it cope with double byte characters must requires a massive
rewrite of
code. So for those non-ASCII users, either wait for the new core JDBC
driver
from Microsoft, or use other third-party costy JDBC type 4 drivers.
Actually quite disappointed for this poor-designed driver from M$, such
a big
company but release such a bad stuff, how can they (or the company where
M$
buy this stuff from) design a JAVA without even consider the i18n issue?
And also, despite the i18n issue, the performance is not good as well,
compare
to the JDBC type 4 driver "i-net SPRINTA?" from
http://www.inetsoftware.de,
the speed is really very slow, mainly because of the bulkiness of the
whole
driver.
Regards,
Brian Chow