<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Minimizr.com &#187; Database</title>
	<atom:link href="http://minimizr.com/blog/category/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://minimizr.com</link>
	<description>More With Less</description>
	<lastBuildDate>Sun, 28 Oct 2007 13:39:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=9424</generator>
		<item>
		<title>How to use Unicode, JDBC and Solid Database</title>
		<link>http://minimizr.com/blog/2006/11/how-to-use-unicode-jdbc-and-solid-database/</link>
		<comments>http://minimizr.com/blog/2006/11/how-to-use-unicode-jdbc-and-solid-database/#comments</comments>
		<pubDate>Mon, 06 Nov 2006 17:25:27 +0000</pubDate>
		<dc:creator>kristian</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.minimizr.com/blog/2006/11/how-to-use-unicode-jdbc-and-solid-database/</guid>
		<description><![CDATA[It is not always so straightforward to use Unicode throughout your application layers. Let&#8217;s say that your Java application&#8217;s default character encoding for file I/O operations, JDBC requests and so on is Unicode. In other words you start you Java application on command line for example with: java -Dfile.encoding=UTF-8 If your Solid Database&#8217;s string types [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>It is not always so straightforward to use <a href="http://www.unicode.org/">Unicode</a> throughout your application layers. Let&#8217;s say that your Java application&#8217;s default character encoding for file I/O operations, JDBC requests and so on is Unicode. In other words you start you Java application on command line for example with: <code>java -Dfile.encoding=UTF-8</code> If your <a href="http://www.solidtech.com/">Solid</a> Database&#8217;s string types are not defined as Unicode, there is a little problem.</p>
<p>In the Java JDBC API tutorial it says:</p>
<blockquote><p>JDBC driver implementations are expected to automatically convert the Java programming language unicode encoding of strings and characters to and from the character encoding of the database being accessed.</p></blockquote>
<p>So, basically JDBC driver should do the conversion between application&#8217;s and database&#8217;s character encoding. But in the Solid Programmers Guide it says:</p>
<blockquote><p>To convert Java applications to support Unicode, the string columns in the database engine need to be redefined with Unicode data types.</p></blockquote>
<p>Actually Solid&#8217;s JDBC driver won&#8217;t even return strings in the same character encoding as they are defined in the database, but it mixes all &#8220;special characters&#8221; wrong. There aren&#8217;t any proprietary parameters you could use on the JDBC connection string to choose the character encoding. So, only working solution is to somehow convert strings in a Solid database in the SQL queries before the JDBC driver returns them. Luckily Solid&#8217;s SQL implements CAST function. You can for example cast VARCHAR to WVARCHAR which is Unicode variable-length character string. Here is an example: <code>SELECT CAST(name AS WVARCHAR) name FROM...</code> And it works like a charm.</p>
]]></content:encoded>
			<wfw:commentRss>http://minimizr.com/blog/2006/11/how-to-use-unicode-jdbc-and-solid-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
