Application Server Solutions for Microsoft IIS and ASP.NET
       solutions   products   partners   company   support   downloads         store
ServletExec Self-Help: FAQ
Back to Search >  Back to Search Results

Faq ID 107
Product JTurbo
Category Internationalization, Known Limitations and Workarounds
Question How do character sets work with SQL Server and JTurbo ?
Answer With SQL Server, a character set is chosen during SQL Server Setup and cannot be changed. It is usually set to the default character set of the platform on which SQL Server is running. So for English Operating Systems this would normally be the ISO Latin-1 (8859_1) character set. By default, JTurbo will use the default character set of the platform on which JTurbo is running when working with char, varchar, and text SQL Server data types. The default charset used by JTurbo can be changed by setting the charset property in your jdbc url or in your datasource that is used to get the database connection. Section 1.4.3 of the JTurbo 3.0 and JTurbo 2005 User Guides provide the jdbc url syntax for setting a property. If you do use the charset property then your application should only use Unicode since JTurbo and SQL Server will handle the conversions back and forth between Unicode and the specified character set.
More details:
JTurbo's charset property effects how JTurbo treats the unicode strings it receives from SQL Server... not the strings it sends to SQL Server.
JTurbo will always send string data to SQL Server as Unicode (2 bytes per character). Depending upon the type of your database column and the manner in which you are sending the query to SQL Server, this may potentially force SQL Server to first store the received Unicode string as nvarchar, and then convert it from nvarchar to the column's charset before inserting it into the column.

The only ways to avoid that expensive type-conversion are:
  1. change the type of your column in the database to be one of the 'n' types (nchar, nvarchar, ntext). SQL Server stores such values as Unicode (no conversion needed)

  2. -OR-
  3. use PreparedStatement.setBytes()

Please see JT FAQ #183 for further details about that peformance-related issue.

Readers of this FAQ may also find FAQ #229 to be helpful.

company media information terms of use privacy policy contact us