<?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>info.michael-simons.eu &#187; Java</title>
	<atom:link href="http://info.michael-simons.eu/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://info.michael-simons.eu</link>
	<description>Just another nerd blog</description>
	<lastBuildDate>Wed, 08 Feb 2012 10:26:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Java stuff</title>
		<link>http://info.michael-simons.eu/2011/11/28/java-stuff/</link>
		<comments>http://info.michael-simons.eu/2011/11/28/java-stuff/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 09:32:00 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Akismet]]></category>
		<category><![CDATA[Autolinker]]></category>
		<category><![CDATA[oEmbed]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=561</guid>
		<description><![CDATA[Here is some Java stuff I&#8217;ve written over the last year for Daily Fratze. All of the stuff is in use on Daily Fratze since June 2011. java-akismet java-akismet is a simple client for Akismet based on the latest version of Apache HttpComponents. java-oembed I really like the idea of oEmbed: A mechanism for auto [...]]]></description>
			<content:encoded><![CDATA[<p>Here is some Java stuff I&#8217;ve written over the last year for <a href="http://dailyfratze.de">Daily Fratze</a>. All of the stuff is in use on <em>Daily Fratze</em> since June 2011.</p>
<dl>
<dt><a href="https://github.com/michael-simons/java-akismet">java-akismet</a></dt>
<dd>java-akismet is a simple client for <a href="http://akismet.com/">Akismet</a> based on the latest version of <a href="http://hc.apache.org/">Apache HttpComponents</a>.</dd>
<dt><a href="https://github.com/michael-simons/java-oembed">java-oembed</a></dt>
<dd>I really like the idea of <a href="http://oembed.com/">oEmbed</a>: A mechanism for auto embedding stuff from other sites so that users don&#8217;t have to paste some html code into a textbox but just plain links. This is my version of a configurable Java client that can autodetect oEmbed endpoints as well as statically configured endpoints.</dd>
<dt><a href="https://github.com/michael-simons/java-autolinker">java-autolinker</a></dt>
<dd>This is my idea of an autolinker based on <a href="http://jsoup.org/">jsoup</a>. If you want to get autolinking right, you have to parse the text. Just scanning for regex that matches urls or email addresses is not enough. This autolinker first parses the text into a DOM tree and passes all text nodes to the configured linkers. At the moment it supports URLs, email addresses and twitter handles.</dd>
</dl>
<p>I&#8217;d be happy if someone can actually use this stuff too or even contribute to it <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=561&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_561" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2011/11/28/java-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySql compatible AES encryption / decryption in Java</title>
		<link>http://info.michael-simons.eu/2011/07/18/mysql-compatible-aes-encryption-decryption-in-java/</link>
		<comments>http://info.michael-simons.eu/2011/07/18/mysql-compatible-aes-encryption-decryption-in-java/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 12:51:57 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[AES]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=527</guid>
		<description><![CDATA[MySQL has an aes_encrypt/aes_decrypt pair of functions (Encryption and Compression Functions) that enable encryption and decryption of data using the official AES algorithm. The functions are easy to use (select AES_ENCRYPT(&#8216;text&#8217;,'password&#8217;)) and the result is easy to store (insert into secrets values HEX(AES_ENCRYPT(&#8216;text&#8217;,'password&#8217;))) as hex values. I used this technique for a while but i [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL has an aes_encrypt/aes_decrypt pair of functions (<a href="http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_aes-encrypt">Encryption and Compression Functions</a>) that enable encryption and decryption of data using the official AES algorithm.</p>
<p>The functions are easy to use (select AES_ENCRYPT(&#8216;text&#8217;,'password&#8217;)) and the result is easy to store (insert into secrets values HEX(AES_ENCRYPT(&#8216;text&#8217;,'password&#8217;))) as hex values.</p>
<p>I used this technique for a while but i wanted to have a more database agnostic version of this encryption and tried to build the same methods with java.</p>
<p>Although it was relatively easy to find the exact cipher mode (which is AES/ECB/PKCS5Padding), i had a real hard time figuring out how the key is calculated from the given password (the key must be 16bytes long, per default MySql uses AES-128). It turns out that the MySQL algorithm just or&#8217;s the bytes of a given passphrase against the previous bytes if the password is longer than 16 chars and just leaves them 0 when the password is shorter than 16 chars. So you can generate a secret key spec in Java for an aes_encrypt/decrypt compatible cipher like so:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.UnsupportedEncodingException</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.crypto.Cipher</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.crypto.spec.SecretKeySpec</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.commons.codec.binary.Hex</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Demo <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> SecretKeySpec generateMySQLAESKey<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> key, <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> encoding<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> finalKey <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">16</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">byte</span> b <span style="color: #339933;">:</span> key.<span style="color: #006633;">getBytes</span><span style="color: #009900;">&#40;</span>encoding<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
				finalKey<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">++%</span>16<span style="color: #009900;">&#93;</span> <span style="color: #339933;">^=</span> b<span style="color: #339933;">;</span>			
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> SecretKeySpec<span style="color: #009900;">&#40;</span>finalKey, <span style="color: #0000ff;">&quot;AES&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">UnsupportedEncodingException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span>... <span style="color: #006633;">args</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Decrypt</span>
		<span style="color: #000000; font-weight: bold;">final</span> Cipher decryptCipher <span style="color: #339933;">=</span> Cipher.<span style="color: #006633;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;AES&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	        				
		decryptCipher.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span>Cipher.<span style="color: #006633;">DECRYPT_MODE</span>, generateMySQLAESKey<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;your super secret passphrase&quot;</span>, <span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span>decryptCipher.<span style="color: #006633;">doFinal</span><span style="color: #009900;">&#40;</span>Hex.<span style="color: #006633;">decodeHex</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;56A34D7AB6225616799F6559AA388F07C2C9E53983111BDD5F49F36461AAD789&quot;</span>.<span style="color: #006633;">toCharArray</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Encrypt</span>
		<span style="color: #000000; font-weight: bold;">final</span> Cipher encryptCipher <span style="color: #339933;">=</span> Cipher.<span style="color: #006633;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;AES&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	        				
		encryptCipher.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span>Cipher.<span style="color: #006633;">ENCRYPT_MODE</span>, generateMySQLAESKey<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;your super secret passphrase&quot;</span>, <span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Select aes_decrypt(unhex('%s'), 'your super secret passphrase');&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span>Hex.<span style="color: #006633;">encodeHex</span><span style="color: #009900;">&#40;</span>encryptCipher.<span style="color: #006633;">doFinal</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hallo nach Aachen&quot;</span>.<span style="color: #006633;">getBytes</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UTF-8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You need <a href="http://commons.apache.org/codec/">Commons Codec</a> to run these. </p>
<p>This isn&#8217;t probably the most secure solution from a cryptographic point of view but it just replicates the built-in MySql function for other databases or just for interoperability. I hope to save someone else time with this as i spent about days about those view lines.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=527&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_527" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2011/07/18/mysql-compatible-aes-encryption-decryption-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Different day, same shit, today: Java 5 on Oracle Enterprise Linux 5</title>
		<link>http://info.michael-simons.eu/2009/01/19/different-day-same-shit-today-java-5-on-oracle-enterprise-linux-5/</link>
		<comments>http://info.michael-simons.eu/2009/01/19/different-day-same-shit-today-java-5-on-oracle-enterprise-linux-5/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 12:00:17 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[OEL5]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=255</guid>
		<description><![CDATA[Worlds collide: Oracle and Sun JDK. Perfect start to ruin a not so bad Monday morning. Background: Need to have a Tomcat Server deployed on a Oracle Enterprise Linux 5 system. I was happy, when i saw a tomcat5 package in the repositories. Great, i thought. All i need. Well. Not. Under Windows you&#8217;ll get [...]]]></description>
			<content:encoded><![CDATA[<p>Worlds collide: Oracle and Sun JDK. Perfect start to ruin a not so bad Monday morning.</p>
<p>Background: Need to have a <a href="http://tomcat.apache.org/">Tomcat Server</a> deployed on a <a href="http://www.oracle.com/technologies/linux/index.html">Oracle Enterprise Linux 5</a> system.</p>
<p>I was happy, when i saw a tomcat5 package in the repositories. Great, i thought. All i need. Well. Not.</p>
<p>Under Windows you&#8217;ll get between one and ten JVM versions installed with on Oracle product (slight exaggerated), within the OEL5 there was only one ancient 1.4.2 JDK. *sigh* Did i mention that  the application that is supposed to run on that thing uses a buttload of Java 5 features?</p>
<p>&#8220;yum search java-&#8221;&#8230; No Java 5. WtF? </p>
<p>There is no Java 5.</p>
<p>Again, do it yourself:</p>
<p><a href="http://wiki.centos.org/HowTos/JavaOnCentOS">This is a nice entry</a> that describes howto build rpms for the &#8220;official&#8221; Sun Java 5 jdk.</p>
<p>I used the following steps to build my rpms:</p>
<ul>
<li>Downloaded this <a href="http://mirrors.dotsrc.org/jpackage/1.7/generic/SRPMS.non-free/java-1.5.0-sun-1.5.0.15-1jpp.nosrc.rpm">rpm</a></li>
<li>Downloaded <em>jdk-1_5_0_15-linux-i586.bin</em> from the <a href="http://java.sun.com/products/archive/">Sun JDK archive page</a></li>
<li>Put the later one into <em>/usr/src/redhat/SOURCES/</em></li>
<li>Built the rpms with <em>rpmbuild &#8211;rebuild java-1.5.0-sun-1.5.0.15-1jpp.nosrc.rpm</em>. If rpmbuild is not installed, it&#8217;s hidden in the package <em>rpm-build</em>, not rpmbuild.</li>
<li>Installed missing libXp</li>
<li>Installed the rpms:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rpm <span style="color: #660033;">-Uvh</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>java-1.5.0-sun-1.5.0.15-1jpp.i586.rpm
rpm <span style="color: #660033;">-Uvh</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>java-1.5.0-sun-devel-1.5.0.15-1jpp.i586.rpm
rpm <span style="color: #660033;">-Uvh</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>java-1.5.0-sun-src-1.5.0.15-1jpp.i586.rpm
rpm <span style="color: #660033;">-Uvh</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>java-1.5.0-sun-demo-1.5.0.15-1jpp.i586.rpm
rpm <span style="color: #660033;">-Uvh</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>java-1.5.0-sun-plugin-1.5.0.15-1jpp.i586.rpm
rpm <span style="color: #660033;">-Uvh</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>java-1.5.0-sun-fonts-1.5.0.15-1jpp.i586.rpm
rpm <span style="color: #660033;">-Uvh</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>java-1.5.0-sun-alsa-1.5.0.15-1jpp.i586.rpm
rpm <span style="color: #660033;">-Uvh</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>redhat<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>i586<span style="color: #000000; font-weight: bold;">/</span>java-1.5.0-sun-jdbc-1.5.0.15-1jpp.i586.rpm</pre></div></div>

</li>
<li>Last step: Choose the right java version with <em>alternatives &#8211;config java</em></li>
</ul>
<p>After that, everything could be fine. Well, it wasn&#8217;t:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sun.misc.InvalidJarIndexException: Invalid index</pre></div></div>

<p>Jehova! Finally not a NPE but something new, at least to me. Sometimes i wonder why i always run into bugs like <a href="http://forums.fedoraforum.org/showthread.php?p=802366">these</a>.</p>
<p>Some script changes and repackages all jar files in some weird ways so that a standard JDK has funny problems. </p>
<p>My solution to it: Reindex everything in <em>/usr/share/java</em> after you&#8217;ve chosen your newly installed java with the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iname</span> <span style="color: #ff0000;">&quot;jakarta*commons*.jar&quot;</span> <span style="color: #660033;">-exec</span> jar <span style="color: #660033;">-i</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;</pre></div></div>

<p>I opted to reindex only the jakarta commons files, that got Tomcat up and running with Java 5.</p>
<p>One last note: The <em>/usr/bin/dtomcat5</em> is broken imho, at least when run from /etc/init.d/tomcat5. In ignores <em>/etc/tomcat5/tomcat5.conf</em> and therefore cannot stop Tomcat.</p>
<p>My solution: Replace</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CATALINA_HOME</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">TOMCAT_CFG</span>=<span style="color: #ff0000;">&quot;/etc/tomcat5/tomcat5.conf&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>(in line 55 on my setup) with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CATALINA_HOME</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">TOMCAT_CFG</span>=<span style="color: #ff0000;">&quot;/etc/tomcat5/tomcat5.conf&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TOMCAT_CFG</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> . <span style="color: #ff0000;">&quot;<span style="color: #007800;">${TOMCAT_CFG}</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>and remove</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CATALINA_HOME</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TOMCAT_CFG</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> . <span style="color: #ff0000;">&quot;<span style="color: #007800;">${TOMCAT_CFG}</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>(in line 105 on my setup).</p>
<p>I wonder why simple things like these always are a pain in the ass. Stupid nuisances that keeps people from getting their work done. *sigh* Not a good start for the week.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=255&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_255" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/01/19/different-day-same-shit-today-java-5-on-oracle-enterprise-linux-5/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Division by zero</title>
		<link>http://info.michael-simons.eu/2008/05/26/division-by-zero/</link>
		<comments>http://info.michael-simons.eu/2008/05/26/division-by-zero/#comments</comments>
		<pubDate>Mon, 26 May 2008 09:25:14 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Shortcuts]]></category>
		<category><![CDATA[Maths]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=168</guid>
		<description><![CDATA[Just a quick reminder for myself: int a = 0/0; // Throws ArithmeticException double d1 = 0/0.0; // d1 is NaN double d2 = 1/0.0; // d2 is Infinity double d3 = -1/0.0; // d3 is -Infinity Can cause some headache if things fall apart in the JDBC driver and not before. Grmpf. Share This]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder for myself:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">int</span> a <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Throws ArithmeticException</span>
<span style="color: #000066; font-weight: bold;">double</span> d1 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">0.0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// d1 is NaN</span>
<span style="color: #000066; font-weight: bold;">double</span> d2 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">0.0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// d2 is Infinity</span>
<span style="color: #000066; font-weight: bold;">double</span> d3 <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">0.0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// d3 is -Infinity</span></pre></div></div>

<p>Can cause some headache if things fall apart in the JDBC driver and not before. Grmpf.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=168&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_168" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/05/26/division-by-zero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCJP, finally!</title>
		<link>http://info.michael-simons.eu/2008/05/06/scjp-finally/</link>
		<comments>http://info.michael-simons.eu/2008/05/06/scjp-finally/#comments</comments>
		<pubDate>Tue, 06 May 2008 11:51:24 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SCJP]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=166</guid>
		<description><![CDATA[More than a year ago i decided to do the Sun Certified Java Programmer. Shortly after i bought this book, the projects at work and at home were somewhat overwhelming and after all, i realized that a big part of the SCJP is about some weird, crazy and sometimes wrong design decisions of the Java [...]]]></description>
			<content:encoded><![CDATA[<p>More than a year <a href="http://info.michael-simons.eu/2007/03/30/sun-certified-programmer-for-java-5/">ago</a> i decided to do the <a href="http://en.wikipedia.org/wiki/Sun_Certified_Professional">Sun Certified Java Programmer</a>. Shortly after i bought <a href="http://www.amazon.de/Certified-Programmer-Study-Guide-310-055/dp/0072253606/">this</a> book, the projects at work and at home were somewhat overwhelming and after all, i realized that a big part of the SCJP is about some weird, crazy and sometimes wrong design decisions of the Java language. Some of them i mentioned under this <a href="http://info.michael-simons.eu/tag/scjp/">tag</a>.</p>
<p>Last month i realized i had some spare time, signed up at <a href="http://www.prometric.com/">Prometric</a> and had a 2nd look at the book and on my good Java experience from the last 6 years. </p>
<p>First thing: The &#8220;Java 5 Study Guide&#8221; isn&#8217;t a bad book but the &#8220;MasterExam&#8221; software on the enclosed cd is a master piece of crap. Not only the gui is as shitty as it gets but some of the answers are just plain wrong.</p>
<p>Second thing: I bought the preparation kit from <a href="http://www.whizlabs.com/scjp/scjp.html">Whizlabs</a> for 50€. This thing isn&#8217;t bad at all and helps you get prepared for the craziness thrown at you.</p>
<p>Third: Being good at something is always great <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  It rocks, really. Like single trail riding or music with electric guitars while driving open. It&#8217;s like drugs but not that unhealthy. </p>
<p>After about 2 weeks of preparing, I arrived 30 minutes early at &#8220;New Horizons&#8221; in Cologne, took the test certainly in english as i prepared with english material and finished somewhat 50 minutes later (you have officially around 3 hours to take the test). The nice proctor asked me if i wanted to use the toilet as she saw my report being printed: 90%, pass! Wooot!</p>
<p>I thought about this <a href="http://blog.pregos.info/index.php/2008/04/23/define-ueberheblichkeit/">post</a> at Jans. I really like the guy who wins a million dollars at Who wants to be a Millionaire and has the guts to call his dad but not ask for help and instead tells him he is going to win a million dollars. I can totally relate to that as i always had fun taking test and scoring at the upper limit <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>So today i&#8217;m gonna eat an extra portion of <a href="http://www.haagendazs.com/products/product.aspx?id=65">Cookies &#038; Cream</a> and leave you with the following piece of Java madness:</p>
<p><span id="more-166"></span></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Braindead2 <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">Integer</span> i1 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">Integer</span> i2 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">Integer</span> i3 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">128</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">Integer</span> i4 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">128</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">Integer</span> i5 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Integer</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">18</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">Integer</span> i6 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Integer</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">18</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		compare<span style="color: #009900;">&#40;</span>i1, i2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		compare<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span>, <span style="color: #cc66cc;">20</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		compare<span style="color: #009900;">&#40;</span>i3, i4<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		compare<span style="color: #009900;">&#40;</span>i5, i6<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> compare<span style="color: #009900;">&#40;</span><span style="color: #003399;">Integer</span> i1, <span style="color: #003399;">Integer</span> i2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Comparing &quot;</span> <span style="color: #339933;">+</span> i1 <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; and &quot;</span> <span style="color: #339933;">+</span> i2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>i1 <span style="color: #339933;">==</span> i2<span style="color: #009900;">&#41;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;same &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;different &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Objects&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>i1.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>i2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;not &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;meaningfully equal&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;---&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>To leave you with some fun, guess the output, leave a comment and mark the next paragraph with your mouse to see the correct answer:</p>
<pre style="border:1px solid grey; color:white;">
Comparing 10 and 10
same Objects
meaningfully equal
---
Comparing 20 and 20
same Objects
meaningfully equal
---
Comparing 128 and 128
different Objects
meaningfully equal
---
Comparing 18 and 18
different Objects
meaningfully equal
---
</pre>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=166&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_166" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/05/06/scjp-finally/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tired of all the powerpoint presentations&#8230;</title>
		<link>http://info.michael-simons.eu/2008/04/23/tired-of-all-the-powerpoint-presentations/</link>
		<comments>http://info.michael-simons.eu/2008/04/23/tired-of-all-the-powerpoint-presentations/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 13:20:47 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[JAX]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Powerpoint]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=163</guid>
		<description><![CDATA[Right now i&#8217;m in Wiesbaden, attending the JAX 2008 conference. The mood is somewhat different compared to the DOAG i used to visit the last years. The people are more open minded, partially much younger and generally try to be much cooler. And for the sake of it, some are even more interesting and after [...]]]></description>
			<content:encoded><![CDATA[<p>Right now i&#8217;m in Wiesbaden, attending the <a href="http://www.jax.de">JAX 2008</a> conference.</p>
<p>The mood is somewhat different compared to the <a href="http://www.doag.org">DOAG</a> i used to visit the last years. The people are more open minded, partially much younger and generally try to be much cooler. And for the sake of it, some are even more interesting and after all, there isn&#8217;t that ongoing whining about Oracle not engaging in Forms 6i Client Server any more (although, i must admit, i somewhat like <a href="/tag/oracle-forms/">Oracle Forms</a> 6i, maybe it&#8217;s a love/hate relationship, trust me, i know both worlds, Java and Forms).</p>
<p>The sessions suffer from one big problem: Many of them just seem to play <em>powerpoint karaoke</em>: Throw in a bunch of crappy slides with a handfull code snippets and sing-a-long to that stuff which means basically: Hind behind the slides.</p>
<p>Let me tell you: This is so boring and pointless. In the past i tried to be polite and always stayed to the end of a session but the last 2 or 3 conferences i can&#8217;t stand it any more. I can read myself, thanks. If you haven&#8217;t got anything additionally to say, just pass me the slide and i&#8217;m fine.</p>
<p>The 3 most interesting sessions where the sessions spoken freely with the slides just illustrating the speech. I especially liked <a href="http://liferay.com/web/bchan/home">Brian Chans</a> presentation of <em>Liferay Portal</em>, <a href="http://blog.springsource.com/main/author/rodj/">Rod Johnsons</a> keynote on the future of J2EE and the most witty one, <a href="http://blogs.tedneward.com/">Ted Newards</a> talk about the renaissance of languages. It was funny, included the audience, was well prepared and freely hold, not to forget the topic: It wasn&#8217;t about the nth framework around the corner but about the nearly philosophy topic about the &#8220;perfect programming language&#8221;.</p>
<p>I really wish that i&#8217;d be creative and intelligent enough to design a language that is not predestined to die an early death, but i ain&#8217;t. But i can distinguish a sharp tool from a spoon if i see one and i can adopt to it very easily. And in that sense i share Teds opinion that a discussion about abstracting things and about the tool itself is of much more value than implementing some arbitrary pattern (i.e. one be the GOF) in just another framework. For example, many implementations of some patterns in frameworks have been rendered obsolete by more powerful and more expressive languages and i&#8217;d like to see this trend go on.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=163&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_163" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/04/23/tired-of-all-the-powerpoint-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JDBC: Autogenerated keys revisited.</title>
		<link>http://info.michael-simons.eu/2008/04/02/jdbc-autogenerated-keys-revisited/</link>
		<comments>http://info.michael-simons.eu/2008/04/02/jdbc-autogenerated-keys-revisited/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 12:44:07 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle DB]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=158</guid>
		<description><![CDATA[Some months ago i wrote about retrieving auto generated values with JDBC from an Oracle Database: JDBC: Get autogenerated keys on a Oracle DB. The solution i presented in the previous article doesn&#8217;t run in a Oracle Java Stored Procedure. To accomplish this, use a callable statement like this: final String sql = &#34;BEGIN INSERT [...]]]></description>
			<content:encoded><![CDATA[<p>Some months ago i wrote about retrieving auto generated values with JDBC from an Oracle Database: <a href="http://info.michael-simons.eu/2007/10/09/jdbc-get-autogenerated-keys-on-a-oracle-db/">JDBC: Get autogenerated keys on a Oracle DB</a>.</p>
<p>The solution i presented in the previous article doesn&#8217;t run in a Oracle Java Stored Procedure. </p>
<p>To accomplish this, use a callable statement like this:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> sql <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;BEGIN INSERT INTO foobar(id, b) VALUES (id.nextval, ?) RETURNING id INTO ?; END;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">CallableStatement</span> cs <span style="color: #339933;">=</span> connection.<span style="color: #006633;">prepareCall</span><span style="color: #009900;">&#40;</span>sql<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
stmt.<span style="color: #006633;">setString</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #0000ff;">&quot;bar&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
stmt.<span style="color: #006633;">registerOutParameter</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span>, <span style="color: #003399;">Types</span>.<span style="color: #006633;">INTEGER</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
stmt.<span style="color: #006633;">executeUpdate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
rv <span style="color: #339933;">=</span> rs.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This way you get the id generated by the sequence id without first selecting and then using it.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=158&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_158" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/04/02/jdbc-autogenerated-keys-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Feeling dizzy&#8230;</title>
		<link>http://info.michael-simons.eu/2008/03/26/feeling-dizzy/</link>
		<comments>http://info.michael-simons.eu/2008/03/26/feeling-dizzy/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 10:45:38 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle DB]]></category>
		<category><![CDATA[Oracle Spatial]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2008/03/26/feeling-dizzy/</guid>
		<description><![CDATA[After staring at this for about a day in various rotations and flips just to get Oracle GeoRaster work together with a homebrew GIS like application made me feel somewhat dizzy. To be cartesian or not cartesian, that is the question Otherwise, Oracle GeoRaster works quite well, at least for that bunch of german TK25 [...]]]></description>
			<content:encoded><![CDATA[<p>After staring at this</p>
<div style="text-align:center;">
<img src="/wp-content/uploads/2008/03/dummy.jpg" alt="dummy" />
</div>
<p>for about a day in various rotations and flips just to get <a href="http://www.oracle.com/technology/sample_code/products/spatial/htdocs/georaster.html">Oracle GeoRaster</a> work together with a homebrew GIS like application made me feel somewhat dizzy. To be cartesian or not cartesian, that is the question <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Otherwise, Oracle GeoRaster works quite well, at least for that bunch of german TK25 maps in GK3 coordinates that used to float around in the filesystem and are now being stored in the database.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=154&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_154" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/03/26/feeling-dizzy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weird java generics&#8230;</title>
		<link>http://info.michael-simons.eu/2008/02/07/weird-java-generics/</link>
		<comments>http://info.michael-simons.eu/2008/02/07/weird-java-generics/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 15:31:48 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Shortcuts]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2008/02/07/weird-java-generics/</guid>
		<description><![CDATA[Generics are not totally bad but one can write really creepy things: final FutureTask&#60;Collection&#60;LeitungsachseTK25&#62;&#91;&#93;&#62; ft = new FutureTask&#60;Collection&#60;LeitungsachseTK25&#62;&#91;&#93;&#62;&#40; new Callable&#60;Collection&#60;LeitungsachseTK25&#62;&#91;&#93;&#62;&#40;&#41; &#123; public Collection&#60;LeitungsachseTK25&#62;&#91;&#93; call&#40;&#41; throws Exception &#123; Seems like XML and Java finally married&#8230; Share This]]></description>
			<content:encoded><![CDATA[<p>Generics are not totally bad but one can write really creepy things:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">final</span> FutureTask<span style="color: #339933;">&lt;</span>Collection<span style="color: #339933;">&lt;</span>LeitungsachseTK25<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> ft <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FutureTask<span style="color: #339933;">&lt;</span>Collection<span style="color: #339933;">&lt;</span>LeitungsachseTK25<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>
    <span style="color: #000000; font-weight: bold;">new</span> Callable<span style="color: #339933;">&lt;</span>Collection<span style="color: #339933;">&lt;</span>LeitungsachseTK25<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">public</span> Collection<span style="color: #339933;">&lt;</span>LeitungsachseTK25<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> call<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span></pre></div></div>

<p>Seems like XML and Java finally married&#8230; <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=147&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_147" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/02/07/weird-java-generics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workshops</title>
		<link>http://info.michael-simons.eu/2007/10/25/workshops/</link>
		<comments>http://info.michael-simons.eu/2007/10/25/workshops/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 10:40:16 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[RL]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/2007/10/25/workshops/</guid>
		<description><![CDATA[Right now i&#8217;m in Frankfurt / Main, attending the iX Workshop Web Programming with Grails (Link in German). The speaker, Dierk König, encouraged live blogging, so here we are: Some ActiveRecord bashing and many, many windows machines around. People fiddling around with their Java Paths, IntelliJ IDEA, which should be way better and more impressive [...]]]></description>
			<content:encoded><![CDATA[<p>Right now i&#8217;m in Frankfurt / Main, attending the <a href="http://www.ix-konferenz.de/einstieg.php?konferenzid=23">iX Workshop Web Programming with Grails</a> (Link in German).</p>
<p>The speaker, Dierk König, encouraged live blogging, so here we are:</p>
<p>Some ActiveRecord bashing and many, many windows machines around. People fiddling around with their Java Paths, IntelliJ IDEA, which should be way better and more impressive than Eclipse or my nifty little TextMate&#8230; In the meantime, everything works fine on a real OS (that is everything else than Windows, for that matter&#8230;)</p>
<p>I&#8217;m already bored and expecting something more to happen. Everything said in the last 3 hours or so has been written down somewhere on the Internet.</p>
<p><del datetime="2007-10-25T10:31:48+00:00">As i don&#8217;t want to bore anybody else, i&#8217;ll guess i have look at my feedreader. </del></p>
<p>Hey, the beat goes on, configuring some weird IDE has stopped&#8230; </p>
<p><ins datetime="2007-10-25T11:00:07+00:00">Would anybody really read my live blogging? <a href="http://en.wikipedia.org/wiki/If_a_tree_falls_in_a_forest">If a tree falls in a forest&#8230;</a></ins></p>
<p><ins datetime="2007-10-25T11:00:07+00:00">JEHOVA! He said G-String <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </ins></p>
<p><ins datetime="2007-10-25T11:05:20+00:00">So again, how are strings called in the Groovy JDK? <a href="http://images.google.com/images?svnum=10&#038;um=1&#038;hl=de&#038;client=safari&#038;rls=de-de&#038;sa=X&#038;oi=spell&#038;resnum=0&#038;ct=result&#038;cd=1&#038;q=g+string&#038;spell=1">G Strings</a>?</ins></p>
<p><ins datetime="2007-10-25T11:48:11+00:00">Hm, breaks are wonderful&#8230; Too much to eat, too much coffee&#8230;</ins></p>
<p><ins datetime="2007-10-25T11:59:46+00:00">The guy next to me didn&#8217;t manage to get the command line version working neither any IDE&#8230; Help is not wished.</ins></p>
<p><ins datetime="2007-10-25T12:01:49+00:00">At least, there&#8217;s a recent issue of german <a href="http://www.ix.de"></a> magazin in the conference file&#8230; With the title story about <i>Ruby on Rails</i>, hrr, hrr <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .<br />
Sometimes i think the IT world needs more egomaniac, rockstar-like developers like <a href="http://www.loudthinking.com/">Heinemeier Hansson</a></ins></p>
<p><ins>Why on earth does one guy write the code from the beamer down on a sheet of paper while he&#8217;s checking his emails at the same time?? Sometimes the outer world seems like a strange place to me. Strange and weird.</ins></p>
<p><ins>Funny thing: Received a 1&amp;1 spam mail about some profiseller foobar this morning. There are two guys from 1&amp;1 at the opposite desk&#8230; Well, i&#8217;m too good educated&#8230;</ins></p>
<p><ins>Is it a good idea to but lawyers and webprogrammers into the same hotel? <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </ins></p>
<p><ins>&#8220;Divs are good for updating thingies on the page&#8221;</ins></p>
<p><ins>I guess its obvious that english isn&#8217;t my native language (can&#8217;t get the thought out of my head that tante is mocking me&#8230;), but language and spoken words always creates a frame for thoughts and far to often, a cage&#8230; And for that being said, one should pay more attention on how to paraphrase things.</ins></p>
<p><ins>I really hate it if the speakers machine is not prepared well. I really do enjoy giving little demonstrations but i&#8217;m fastidious to paranoid that everything is taken care of, tested and proved to be working&#8230; If their only 8 hours time, not working improvisation sucks.</ins></p>
<p><ins>I have to say, i really do like <a href="http://groovy.codehaus.org/">Groovy</a>, it&#8217;s a chance to get some serious scripting into Java at home&#8230; err i wanted to say, at work. People tend to focus on just one language and limiting themselves, but with Groovy i can argue: It&#8217;s Java with some fancy things on top. And at least for me, it&#8217;s a good thing.</ins></p>
<p><ins>&#8220;Mit diesen Dingen kann man beliebig fancy werden&#8221; &#8212; Argh, my head schmerzts&#8230;</ins></p>
<p>I should collect some pudding for <a href="http://www.the-gay-bar.com">the gay bar</a> to see if this guy is really as witty as he writes. Would pudding suffer to pay you or do want some Hägen Dasz?</p>
<p>Party is over&#8230; Good night &amp; good fight <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=127&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_127" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2007/10/25/workshops/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.892 seconds -->

