<?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>Gerbrand on ICT &#187; gerbrand</title>
	<atom:link href="http://www.gerbrand-ict.nl/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gerbrand-ict.nl</link>
	<description>Weblog on JEE and software-engineering</description>
	<lastBuildDate>Wed, 11 Aug 2010 20:51:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Google buys Instantiations</title>
		<link>http://www.gerbrand-ict.nl/2010/08/google-buys-instantiations/</link>
		<comments>http://www.gerbrand-ict.nl/2010/08/google-buys-instantiations/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 20:51:12 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Various]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=451</guid>
		<description><![CDATA[A while a go I used to do Swing development, and I sometimes used the tool of Instantiations to develop my GUI. I quite liked the tool. Before that I used Visual Basic and Visual Studio frequently. I never fully understood why people would fiddle so much with pixels, stylesheets, colors etc when you could [...]]]></description>
			<content:encoded><![CDATA[<p>A while a go I used to do Swing development, and I sometimes used the tool of <a href="http://instantiations.com/">Instantiations </a>to develop my GUI. I quite liked the tool.<br />
Before that I used Visual Basic and Visual Studio frequently. I never fully understood why people would fiddle so much with pixels, stylesheets, colors etc when you could just design your GUI visually.<br />
Well, Instantiations has GWT design tool as well. I recently tried it out very shortly. The tool looked very nice.<br />
I just recently Google bought Instantiations. Will this mean developer productivity in frontend development is cool again?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/08/google-buys-instantiations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>McDonalds running Linux</title>
		<link>http://www.gerbrand-ict.nl/2010/08/mcdonalds-running-linux/</link>
		<comments>http://www.gerbrand-ict.nl/2010/08/mcdonalds-running-linux/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 20:21:24 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Various]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=459</guid>
		<description><![CDATA[A unix like OS on their video-screens outside, in shopping center Hoog Caterijne, Utrecht. At least something else then those Windows 95/98/NT screens I often see running at terminals, when they&#8217;ve crashed.]]></description>
			<content:encoded><![CDATA[<p>A unix like OS on their video-screens outside, in shopping center Hoog Caterijne, Utrecht. At least something else then those Windows 95/98/NT screens I often see running at terminals, when they&#8217;ve crashed.</p>
<p><a href="http://www.gerbrand-ict.nl/wp-content/uploads/2010/08/2010-08-01_14-54-53_5.jpg"><img class="alignnone size-medium wp-image-460" title="McDonalds screen" src="http://www.gerbrand-ict.nl/wp-content/uploads/2010/08/2010-08-01_14-54-53_5-168x300.jpg" alt="" width="168" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/08/mcdonalds-running-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stuff to research: JDO on Cassandra, GIT on Windows, Restlet, VMForce</title>
		<link>http://www.gerbrand-ict.nl/2010/07/stuff-to-research-jdo-on-cassandra-git-on-windows-restlet-vmforce/</link>
		<comments>http://www.gerbrand-ict.nl/2010/07/stuff-to-research-jdo-on-cassandra-git-on-windows-restlet-vmforce/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 22:15:13 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[nosql]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=452</guid>
		<description><![CDATA[Just had evening of just trying out stuff and not finishing anything on my Windows machine. I wanted to try out a persistence API for Cassandra. There&#8217;s a JPA implementation for Cassandra: Kundera, as well as JDO implementation, on top (or using) datanucleus: datanucleus-cassandra. Just to clarify why I would want such a thing: nosql [...]]]></description>
			<content:encoded><![CDATA[<p>Just had evening of just trying out stuff and not finishing anything on my Windows machine.</p>
<p>I wanted to try out a persistence API for <a href="http://cassandra.apache.org/">Cassandra</a>. There&#8217;s a JPA implementation for Cassandra: <a href="http://anismiles.wordpress.com/2010/06/30/kundera-knight-in-the-shining-armor/">Kundera</a>, as well as JDO implementation, on top (or using) datanucleus: <a href="http://github.com/PedroGomes/datanucleus-cassandra">datanucleus-cassandra</a>.</p>
<p>Just to clarify why I would want such a thing: <strong>nosql </strong>solutions such as Cassandra are, in essence distributed key-value stores. I know, from following a few classes on databases and distributed databases when attending the university that&#8217;s a whole lot more complicated to implement then it may seem.<br />
Nevertheless, to do anything useful with that you need a layer on top of the key-value store. Basically all SQL databases like Oracle or MySQL have SQL layer around there key-value store. But the nice thing about stuff like Cassandra you can put something more convenient on top.</p>
<p>I wanted to try out both, starting with the JDO version, as that seemed  more like a natural fit, and I once started ORM with JDO 1.0 many years  ago.<br />
I&#8217;d need a git client on Windows, and apparently there&#8217;s already a <a href="http://code.google.com/p/tortoisegit/">Tortoise Git client</a>, based on the truly great <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a>, on of the tools I really miss on my Mac. The client version of git first had to be installed, but that was quite easy as well, just download and install <a href="http://code.google.com/p/msysgit/">msysgit</a>.<br />
The tortoisegit client looks very well, and seems easy to use. At least I got the code of datanucleus-cassandra in a breeze. Well now it&#8217;s kind of late, I&#8217;ll try out later.</p>
<p><a href="http://commons.wikimedia.org/wiki/File:Hector_Cassandra_Pomarici_Santomasi.jpg"><img class="alignnone size-medium wp-image-456" title="541px-Hector_Cassandra_Pomarici_Santomasi" src="http://www.gerbrand-ict.nl/wp-content/uploads/2010/07/541px-Hector_Cassandra_Pomarici_Santomasi-270x300.jpg" alt="" width="270" height="300" /></a></p>
<p>Other stuff I want to try out: creating a Rest service using <a href="http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet.html">Restlet </a>on Google AppEngine. Just to find out how that works. But later.</p>
<p>Finally I saw a demo on <a href="http://www.vmforce.com/">VMForce</a>. Looks very promising, as I like Spring for development and that&#8217;s what you&#8217;d use. Nothing is released however, now there&#8217;s just articles and a demo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/07/stuff-to-research-jdo-on-cassandra-git-on-windows-restlet-vmforce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database upgrade during deployment</title>
		<link>http://www.gerbrand-ict.nl/2010/07/database-upgrade-during-deployment/</link>
		<comments>http://www.gerbrand-ict.nl/2010/07/database-upgrade-during-deployment/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 15:33:18 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=446</guid>
		<description><![CDATA[I want to create an installation package of a Java application. Part of the installation involves upgrading a SQL database (Oracle) &#8211; by running a few SQL scripts. Creating the SQL scripts to do the update by itself isn&#8217;t the problem, however I need to find a way to easily run those script. Of course [...]]]></description>
			<content:encoded><![CDATA[<p>I  want to create an installation package of a Java application. Part of  the installation involves upgrading a SQL database (Oracle) &#8211; by running  a few SQL scripts. Creating the SQL scripts to do the update by itself  isn&#8217;t the problem, however I need to find a way to easily run those  script.</p>
<p>Of  course Oracle has something like SQLPlus, but that would mean SQLPlus  has to be installed on the machine from where the package is installed.  Another problem with SQLPlus is that it&#8217;s not so userfriendly.</p>
<p>Using  JDBC and some programming I can easily create something that would  check what current version of my application is installed, and then run  the needed SQL scripts to upgrade the database. However, even easy  things take some time and I&#8217;d think there are already some existing  solutions.</p>
<p>I  was about to ask a question on stackoverflow, but before I finished  typing my question stackoverflow already came up with a similar  question: <a href="http://stackoverflow.com/questions/109746/update-a-backend-database-on-software-update-with-java">Update a backend database on software update with Java</a>. I&#8217;ll have to try out on of the suggested solutions, <a rel="nofollow" href="http://www.liquibase.org/">Liquibase</a>, <a rel="nofollow" href="http://code.google.com/p/dbmigrate/">dbmigrate</a> and maybe <a rel="nofollow" href="http://autopatch.sourceforge.net/">Autopatch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/07/database-upgrade-during-deployment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Motorola milestone: frustating as hell</title>
		<link>http://www.gerbrand-ict.nl/2010/07/motorola-milestone-frustating-as-hell/</link>
		<comments>http://www.gerbrand-ict.nl/2010/07/motorola-milestone-frustating-as-hell/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 12:35:40 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[motorola]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=435</guid>
		<description><![CDATA[Since a few weeks I have a Motorola Milestone, the European version of the Motorola Droid. For a small computer/handheld works very well. I can browse, use email, install application, write documents. As a phone the device fails. There&#8217;s a lot of talk about the IPhone 4 supposedly having bad reception. Well, the Motorola Milestone [...]]]></description>
			<content:encoded><![CDATA[<p>Since a few weeks I have a Motorola Milestone, the European version of the Motorola Droid. For a small computer/handheld works very well. I can browse, use email, install application, write documents. As a phone the device fails.<br />
<a href="http://www.gerbrand-ict.nl/wp-content/uploads/2010/07/Motorola-Milestone-2.jpg"><img class="alignnone size-medium wp-image-438" title="Motorola-Milestone" src="http://www.gerbrand-ict.nl/wp-content/uploads/2010/07/Motorola-Milestone-2-300x250.jpg" alt="" width="300" height="250" /></a></p>
<p>There&#8217;s a lot of talk about the IPhone 4 supposedly having bad reception. Well, the Motorola Milestone has a problem too. When calling, I very often incidentally put the telephone to mute, which causes the other party not to hear me anymore. This is caused by the mute button in the middle of the touch screen. I often press is that area with my hear while calling, as I have the habit of putting my telephone to my ear&#8230; Well apparently few people in Motorola though of that.</p>
<p><span id="more-435"></span> The Motorola Milestone has a proximity sensor that supposed to turn of the screen while calling. However, for me, that doesn&#8217;t work. I searched for a solution on the <a href="https://supportforums.motorola.com/search.jspa?resultTypes=&amp;dateRange=lastyear&amp;peopleEnabled=true&amp;q=proximity+sensor+mute&amp;containerType=&amp;container=&amp;containerName=&amp;username=&amp;rankBy=30&amp;numResults=15">Motorola forum</a>. There a quite a few threads about this issue, like <a href="https://supportforums.motorola.com/message/62983#62983">this</a>, <a href="https://supportforums.motorola.com/thread/17080?start=105&amp;tstart=0">this one</a>, this on <a href="https://supportforums.motorola.com/message/98288#98288">long hair</a> and this one saying it&#8217;s <a href="https://supportforums.motorola.com/message/81811#81811">a hardware problem</a>.<br />
Many answers are infuriating rather than useful. Most of them have tips on how to properly hold the phone (in your right hand, below ear lob, under your hair). Arg, that&#8217;s not what I want to hear. Apart from the fact that doesn&#8217;t work, I don&#8217;t want a whole instruction who to hold my phone when I&#8217;m using a mobile phone for over 10 years.<br />
Some idiots even say they have the problem, but still love the Droid.</p>
<p>At least some sort of <a href="https://supportforums.motorola.com/people/Matt">official person</a> who sorts of answers to the problem. People at Motorola are working on an update.  That&#8217;s not of much help. Finally, in <a href="https://supportforums.motorola.com/message/131040#131040">this thread</a> I found a more useful answer. There&#8217;s an application called Screen Suite, which allows you to lock the screen while calling. It only costs $1.99. Bought it already, I have the phone to long to get my money back. I just installed the application, Screen Suite seems to work.</p>
<p>Well bottom line, <a href="http://www.apple.com/hotnews/openiphoneletter/">Apple </a>isn&#8217;t the only one with a problematic telephone. And avoid the Motorola Droid and Milestone, at least when you also want to make phonecalls with your smartphone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/07/motorola-milestone-frustating-as-hell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple: 32 bit or 64 bit</title>
		<link>http://www.gerbrand-ict.nl/2010/07/apple-32-bit-or-64-bit/</link>
		<comments>http://www.gerbrand-ict.nl/2010/07/apple-32-bit-or-64-bit/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 07:26:29 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Various]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=432</guid>
		<description><![CDATA[I am about to download the latest version of Eclipse IDE, Helios. Naturally there are packages for various types of platforms. I know I have a Mac, however I also had to choose between 32 bit version and 64 bit version. There was a time I exactly knew these kind of things, but then I [...]]]></description>
			<content:encoded><![CDATA[<p>I am about to download the latest version of Eclipse IDE, <a href="http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliosr">Helios</a>. Naturally there are packages for various types of platforms. I know I have a Mac, however I also had to choose between 32 bit version and 64 bit version. There was a time I exactly knew these kind of things, but then I also used to build my computer myself.<br />
Fortunately, there&#8217;s a Apple support page which exactly tells me exactly that: <a href="http://support.apple.com/kb/ht3696">How to tell if your Intel-based Mac has a 32-bit or 64-bit processor</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/07/apple-32-bit-or-64-bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apprentice in software</title>
		<link>http://www.gerbrand-ict.nl/2010/07/apprentice-in-software/</link>
		<comments>http://www.gerbrand-ict.nl/2010/07/apprentice-in-software/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 07:25:28 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=430</guid>
		<description><![CDATA[When you want to become a pilot, you&#8217;ll first have to be a co-pilot (after your training). You&#8217;ll won&#8217;t become a medical professional without working with an experienced doctor first. As software engineering is a profession that also combines deep knowledge, analytical skills and experience as well, why would this be any difference? My company, [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to become a pilot, you&#8217;ll first have to be a co-pilot (after your training). You&#8217;ll won&#8217;t become a medical professional without working with an experienced doctor first. As software engineering is a profession that also combines deep knowledge, analytical skills and experience as well, why would this be any difference?</p>
<p>My company, Xebia, has started a master-apprentice program in the Netherlands. See <a href="http://www.xebia.com/apprenticeship">Apprenticeship Program</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/07/apprentice-in-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual secretary</title>
		<link>http://www.gerbrand-ict.nl/2010/07/virtual-secretary/</link>
		<comments>http://www.gerbrand-ict.nl/2010/07/virtual-secretary/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 00:35:21 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=425</guid>
		<description><![CDATA[Most of my friends are in there are twenty/thirty something and have quite a busy (social live). Making appointsments can be quite cumbersome, especially when multiple people are involved. Fortunately, there&#8217;s electronic help, there are websites were you can schedule appointments. I&#8217;ve used the Dutch sites Datumprikker.nl and the fairly new startup Pleft. Although there [...]]]></description>
			<content:encoded><![CDATA[<p>Most of my friends are in there are twenty/thirty something and have quite a busy (social live). Making appointsments can be quite cumbersome, especially when multiple people are involved. Fortunately, there&#8217;s electronic help, there are websites were you can schedule appointments. I&#8217;ve used the Dutch sites <a href="http://www.datumprikker.nl">Datumprikker.nl</a> and the fairly new startup <a href="http://www.pleft.com">Pleft</a>. Although there both quite easy to start using, I&#8217;m far from satisfied. Datumprikker and pleft both have quite limited functionality. The only thing you can enter are available dates and a list of contacts/emailaddresses with whom you want to make an appointment.</p>
<p>What would like is integration with my electronic calendar of Google Calender (personal) and MS Exchange (work). That way, almost automatically available dates could be picked. Both Google Calendar as the latest version of Exchange can make there calender available via ical &#8211; so integration should be quite easy. When all people you want to make an appointment with have there calenders integrated as well with the appointment tool, an appointment could be created automatically &#8211; just like a secretary would do by calling other people&#8217;s secretaries.</p>
<p>Furthermore, besides entering emailaddresses, picking contacts from my address book from either google or MS Exchange would be more convenient.</p>
<p>I was thinking, such an application shouldn&#8217;t be hard to make. I wasn&#8217;t the only one with that idea. Recently someone suggested another website: <a href="http://www.doodle.com/">Doodle</a>. From what I can see, that website seems a whole lot better than there Dutch counterparts. Integration with Google Calendar and Contacts. Integration with Exchange and possibility to add ical calenders. Looks good, saves me from creating a startup <img src='http://www.gerbrand-ict.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/07/virtual-secretary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Springsource and electric cars</title>
		<link>http://www.gerbrand-ict.nl/2010/06/springsource-and-electric-cars/</link>
		<comments>http://www.gerbrand-ict.nl/2010/06/springsource-and-electric-cars/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 15:18:56 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Various]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=416</guid>
		<description><![CDATA[Just read an article on electric cars in of the Saturday&#8217;s edition of the NRC &#8211; a Dutch newspaper, which can be found online at the authors blog (in Dutch). Some entrepreneur in electric cars is mentioned by the name of Alef Arendsen. The name did not immediately rang a bell, but when it was [...]]]></description>
			<content:encoded><![CDATA[<p>Just read an article on electric cars in of the Saturday&#8217;s edition of the <a href="http://www.nrc.nl/">NRC</a> &#8211; a Dutch newspaper, which can be found online at the <a href="http://weblogs.nrc.nl/luyendijk/2010/06/21/jeroen-pauw-als-rolmodel/">authors blog (in Dutch)</a>. Some entrepreneur in electric cars is mentioned by the name of Alef Arendsen. The name did not immediately rang a bell, but when it was mentioned got his wealth after the sale of a opensource software company he co-founded I recalled. Alef Arendsen was part of <a href="http://www.springsource.com/people/aarendsen">SpringSource</a>, early on and made Spring big in the Netherlands (hm, I think I&#8217;ve read about the framework in about 2004 on javaworld, found it pretty cool &#8211; too bad I didn&#8217;t do anything anything with it by then). He quit SpringSource about a year ago because he wanted to do something else.<br />
He has now started a company in electric cars: <a onclick="pageTracker._trackPageview('/outgoing/www.thenewmotion.com?referer=http://www.springsource.com/people/aarendsen');" href="http://www.thenewmotion.com/">The  New Motion</a>, which he mentions in his blog: <a href="http://blog.arendsen.net/index.php/2010/06/09/challenges-when-introducing-new-technologies-to-the-market/">Challenges when introducing new technologies to the market</a>. Quite a surprising move, but then again, you could say <a href="http://en.wikipedia.org/wiki/Electric_car">Electric cars</a> are to traditional Petrol cars as Spring is to EJB2/J2EE.</p>
<div id="attachment_417" class="wp-caption alignnone" style="width: 310px"><a href="http://www.gerbrand-ict.nl/wp-content/uploads/2010/06/Bundesarchiv_Bild_183-1990-1126-500_Kraftdroschke.jpg"><img class="size-medium wp-image-417" title="German electric car, 1904" src="http://www.gerbrand-ict.nl/wp-content/uploads/2010/06/Bundesarchiv_Bild_183-1990-1126-500_Kraftdroschke-300x223.jpg" alt="" width="300" height="223" /></a><p class="wp-caption-text">German electric car, 1904, with the chauffeur on top</p></div>
<p>(Above picture from <a href="http://en.wikipedia.org/wiki/Electric_car">Wikipedia</a> &#8211; of course electric cars aren&#8217;t actually new, just as the idea dependency injection or reversion of control existed long before spring)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/06/springsource-and-electric-cars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxying authentication using JBoss</title>
		<link>http://www.gerbrand-ict.nl/2010/06/proxying-authentication-using-jboss/</link>
		<comments>http://www.gerbrand-ict.nl/2010/06/proxying-authentication-using-jboss/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 23:00:19 +0000</pubDate>
		<dc:creator>gerbrand</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.gerbrand-ict.nl/?p=264</guid>
		<description><![CDATA[Wouldn&#8217;t it be nice if the connection to the database is done using the same username as the username used to login to a (JEE) application? Oracle has a solution for that: proxy authentication.  When using proxy authentication, every application user is also a database user: meaning when someone logins to your JEE webapplication using [...]]]></description>
			<content:encoded><![CDATA[<p>Wouldn&#8217;t it be nice if the connection to the database is done using the same username as the username used to login to a (JEE) application? Oracle has a solution for that: <a href="http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/proxya.htm">proxy authentication</a>.  When using proxy authentication, every application user is also a database user: meaning when someone logins to your JEE webapplication using username john, he&#8217;ll also access the database as user john. This way all actions of the user are logged at the database-level: an administrator or auditer can see exactly what data a certain user modified or accessed during a JEE session.</p>
<p><span id="more-264"></span></p>
<p>Also, this allows for fine-grained security at database level: <a href="http://www.oracle.com/technology/deploy/security/database-security-10g/virtual-private-database/index.html">Virtual Private Database</a>.</p>
<div id="attachment_297" class="wp-caption alignnone" style="width: 466px"><a href="http://www.oracle.com/technology/deploy/security/database-security-10g/virtual-private-database/index.html"><img class="size-full wp-image-297" title="virtual-private-database1" src="http://www.gerbrand-ict.nl/wp-content/uploads/2009/06/virtual-private-database1.gif" alt="Virtual private database" width="456" height="175" /></a><p class="wp-caption-text">(c) Oracle</p></div>
<p>As described in the above image and referenced article, the user identified by userid 106 (let&#8217;s say that&#8217;s user john) will access the database using a private database connection. The user can only access rows that have that userid as primary or foreign key.  John can&#8217;t see the passwords, orders, credit card data or anything of other users even if he would somehow hack the webapplication. How to set up this finegrained securiy is beyond this article, but I hope the above example explains what the purpose VPD is.</p>
<p>If you develop your JEE software using Oracle software  proxy authentication requires only a bit of configuration, for example, see the following article how to setup proxy authentication using <a href="http://blogs.oracle.com/jheadstart/2008/01/28/">JHeadstart</a>.</p>
<p>However, what if you&#8217;re JEE applicication consists of non-oracle software? Can you still use proxy authentication when you use software like JBoss, Hibernate, IBatis, MyFaces, Wicket etc? Yes you can! I&#8217;ll explain below how to set up proxy authentication using JBoss in such a way you don&#8217;t have to modify any of the code that uses JDBC, directly or indirectly.</p>
<ul>
<li>First a way is needed to set a username for each (JDBC) database connection retrieved. <a href="http://www.it-eye.nl/weblog/2005/09/12/oracle-proxy-users-by-example/">It-eye weblog</a> explains how to open a connection to a database using java, and then switch to another username.</li>
<li>Secondly, in your application users should authenticate them self using the default mechanism of J2EE 1.4 (and higher) application, using <a href="http://java.sun.com/javase/technologies/security/">JAAS</a>. Usually creating a security policy inside your web.xml or inside your ear is enough. Here&#8217;s the information how to do this under JBoss: <a href="http://www.jboss.org/community/wiki/SecureAWebApplicationUsingACustomForm">Secure a webapplication</a>.<br />
Since we&#8217;re using a database, the best option would be to use database based authentication, meaning user information comes out of a database table. There&#8217;s a lot of documentation on the web how to do add security, so I won&#8217;t repeat that here.</li>
<li>Database connection in JBoss are retrieved using connection pooling, as is custom in any JEE server.  You can create a custom connection pool, that changes the switches to the user name that is currently logged in at the webapplication. That way, every action on the database is done under a database user that is currently logged in.Do to be able to do that, first, you&#8217;ll need a custom connection factory that extends the default connection factory. Our connection factory will return a customized datasource that modifies code.Here&#8217;s a code listing:
<pre class="brush: java;">package nl.gerbrandict.dbconnaudit;

import java.sql.SQLException;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionManager;

import org.apache.log4j.Logger;
import org.apache.commons.lang.StringUtils;
import org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory;

/**
 * An extended connection factory, that uses the Oracle feature to change the username of an existing connection
 *

 * When a user authenticated on the application server, the database connection will switch to that username.
 * This allows for better auditing and potentially for improved security.
 *
 * Properties (get'ers and set'ters) can be set via the configuration section of the -ds file
 * @author gvdieijen
 */
public class DBConnAuditConnectionFactory extends LocalManagedConnectionFactory {

    private String defaultProxyUser;

    public DBConnAuditConnectionFactory() throws SQLException {
        super();

    }

    @Override
    public Object createConnectionFactory(ConnectionManager cm) throws ResourceException {
        return new OracleWrapperDataSource(this, cm);
    }

    public void setEnableProxySession(Boolean enableProxySession) {
        this.enableDbConnAudit = enableProxySession;
    }

    public void setDefaultProxyUser(final String defaultProxyUser) {
        if (StringUtils.isEmpty(defaultProxyUser)) {
            this.defaultProxyUser=null;
        } else {
             this.defaultProxyUser = defaultProxyUser;
        }
    }

    /**
     * Default db user to open proxy session for, when no authenticated user is active
     * @return
     */
    public String getDefaultProxyUser() {
    	return this.defaultProxyUser;
    }
}</pre>
<p>As you can see, the file returns a OracleWrapperDatasource. That&#8217;s custom class, that extends the default WrapperDatasource of JBoss, and changes the user of jdbc connection just before the connection is handed of to the application. To speak in terms of the fine book</li>
<li>Now, How can you use that new class? They have to be packed into a rar file. Functionally, that&#8217;s a Resource Adapter, a module that allows a J2EE application to use resources. Technically (and practically), it&#8217;s just a jar-archive similar to a war, with a different extension. Maven can create these files automatically for you, if you set the packaging type to rar instead of jar (which is the default).</li>
<li>When you download JBoss, you&#8217;ll get a sample connection pool for a in-memory database: default-ds.xml, located in the server/default/deploy directory of jboss. To use the custom classses, copy the file into (for example) myoracleproxy-ds.xml and create a minor modification so a custom connection factory is used &#8211; update the managedconnectionfactory property, that a custom connectionfactory is used, that returns the proxied connections:
<pre class="brush: xml;">&lt;managedconnectionfactory-class&gt;nl.gerbrandict.dbconnaudit.DBConnAuditConnectionFactory&lt;/managedconnectionfactory-class&gt;</pre>
</li>
</ul>
<p>All in all, after some tweaking, all queries and updates to your Oracle database are done under the J2EE username. This means when user Joe logs in, all his database access will be logged under user Joe as well. This can improve auditing as well as security.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gerbrand-ict.nl/2010/06/proxying-authentication-using-jboss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
