<?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>underdog-blog &#187; NCLOB</title>
	<atom:link href="http://blog.underdog-projects.net/tag/nclob/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.underdog-projects.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 23 Oct 2010 18:43:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>writing Unicode characters to Oracle with TIBCO BusinessWorks</title>
		<link>http://blog.underdog-projects.net/2009/05/writing-unicode-characters-to-oracle-with-tibco-businessworks/</link>
		<comments>http://blog.underdog-projects.net/2009/05/writing-unicode-characters-to-oracle-with-tibco-businessworks/#comments</comments>
		<pubDate>Thu, 28 May 2009 12:19:33 +0000</pubDate>
		<dc:creator>jens</dc:creator>
				<category><![CDATA[TIBCO]]></category>
		<category><![CDATA[BusinessWorks]]></category>
		<category><![CDATA[NCLOB]]></category>

		<guid isPermaLink="false">http://blog.underdog-projects.net/?p=282</guid>
		<description><![CDATA[As always, I get the most puzzling mysteries from work requirements. I got the requirement of sending an email with Russian characters through TIBCO BusinessWorks. So far so good. BusinessWorks has full support of Unicode, so it should be not a problem to get this one running. Lucky me the reality looks different. For this [...]]]></description>
			<content:encoded><![CDATA[<p>As always, I get the most puzzling mysteries from work requirements. I got the requirement of sending an email with Russian characters through TIBCO BusinessWorks. So far so good. BusinessWorks has full support of Unicode, so it should be not a problem to get this one running. Lucky me the reality looks different.</p>
<p>For this email system a database template system was used and of course the database was an upgraded Oracle 10g, so all the columns (for historic reasons) were Latin-1 and not Unicode.</p>
<p>But a simple Google query even showed a solution for this problem. Oracle introduced, exactly for this case, a new data type (NCHAR &#8211; means Unicode character). After changing the table column from CLOB to NCLOB the database should have the ability to store Unicode characters, even if it is running in Latin-1 mode.</p>
<p>First thing I tried, was to insert a valid Russian email template into the database and lucky me, the text which was stored in the database, was still a bunch of invalid Latin-1 characters (character code 0xbf).</p>
<p>After quite some googling I came  to <a href="http://www.Oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/nchar/readme.html">this Oracle article</a>. In that article Oracle explains a bit more how to force the JVM to use Unicode characters for the JDBC connection instead of the character set presented from the database. With nothing to lose I tried it in my designer via modifying the designer.tra (I just appended the following parameter).</p>
<pre>
 -DOracle.jdbc.defaultNChar=true
</pre>
<p>After that, it worked like a charm. Now it was possible to write Unicode characters to the new created NCLOB columns in the database.</p>
<p>After creating the template and doing a trial run I got curious what would happen if I removed that parameter and tried to read from the Unicode column. To my surprise it worked out-of-box. So you can read Unicode characters from an Oracle database without modifying anything. The indifferences just happen if you want to write via JDBC.</p>
<p>To round this up this bug is not limited to TIBCO BusinessWorks. I also tried it with a tool named <a href="http://www.minq.se/products/dbvis/">DbVisualizer</a> (also Java based) and (what really annoys me, because it is c-based and shouldn&#8217;t have this JDBC bug) <a href="http://tora.sf.net">tora</a>. All showed the same result on writing to that database.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.underdog-projects.net/2009/05/writing-unicode-characters-to-oracle-with-tibco-businessworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

