pureXML in DB2

pureXML is the native XML storage capability in IBM DB2. It allows for whole XML documents to be stored in a DB2 table column, and for them to be easily queried via either SQL or XQuery or some combination of the two.DB2 pureXML book Getting Started with DB2 has a decent introduction to both . There’s also schema validation, versioning, and other esoteric features.

I’ve played with it a fair bit and found it quite performant in my admittedly limited scenario of a couple thousand xml docs.

Conor O’Mahony blogs extensively on the topic. In terms of community, there’s an official site, a comprehensive wiki, a forum.


Battle of Gaugamela

October 1st is not just the anniversary of Alexander the Great’s triumph at Gaugamela. It’s not just the birthday of Jimmy Carter. It’s not just the National Day of the PRC.

It’s also the online community action day. It is the day when we comment, we respond, we link, and we blog. It is the day when we go on a forum, like the DB2 Express forum, and answer just one question. It is the day when we pass on the urls of good sites, perhaps PlanetDB2 or ChannelDB2, to our friends and colleagues. It is the day when we find the blog posts that helped us solve an intractable question and say “Thanks! Gracias! Paldies! Spasibo!”


A month ago, Lisa and I returned from Germany. Along with Poland, Latvia, and Estonia, it was the site of our honeymoon. Germany was, of course, beautiful, but I was fascinated to see Latvia again. I hadn’t been back since I had left with my parents in 1995, and it has changed innumerably for the better.

Lisa and Leo Berlin Haupstbahnhof Old Warsaw at Night Riga Meat Market

But I digress. Not only have I learned to say “danke schön”, but so has the free DB2 book. Getting Started with DB2 Express-C is now available in Deutsch.

Getting Started with IBM DB2

I find that it is a good introduction to DB2 Express-C. The latter is the free database server in connection with which I am employed, but whose opinions I do not necessarily represent.

Repair table failed. Please run repair table.

One of the tables of my MediaWiki installation crashed. When I tried to repair it, I got this less-than-helpful error message. So did the mysqlcheck utility when I SSHed to the server. However, the command has extra options that can be used to repair high levels of corruptions, such as when the MYI is missing.


John Resig writes very positively about Jaxer. It runs Javascript on the server while serving documents to the client, with seamless communication between JS on the client and JS on the server.

Jaxer provides:

  1. Full DOM on the server
  2. Shared code between client and server
  3. Database, file, and socket access from JavaScript
  4. Familiar APIs
  5. Integration with PHP, Java, Rails, etc. apps

In other news, IE8 will use the latest rendering mode by default for documents with the HTML5 doctype:

Finally, Good Math has a published a good defense of Google’s MapReduce algorithm.


Base2 has just come out in beta on Google Code. It’s hosted there and can be included straight off the Google Code server.

I think it’s a really neat library because it basically fixes all browsers so that the built-in DOM, events, etc work the same way. Instead of providing an API of its own, it makes the existing API work consistently and reliably.

Base2 Features:
– A fast implementation of the Selectors API
– Fixes broken browser implementations of the DOM events module including document.createEvent(), dispatchEvent(), addEventListener(), etc
– Supports DOMContentLoaded
– Fixes getAttribute()/hasAttribute()/setAttribute() (Internet Explorer)
– Implements a few other useful DOM methods like getComputedStyle() and compareDocumentPosition()
– Supports a variety of browsers including ancient browsers like IE5.0 (Windows and Mac)

Dean Edwards has also done the excellent Packer Javascript minifier. It has probably the most in-depth support for obscure language features that simpler minifiers tend to mangle.

Rails and DB2 data types

When creating a table in a Rails migration, you have to specify data types using platform-agnostic names. The mapping of Rails types onto DB2 types is defined in ibm_db_adapter.rb:

Useful Resources

InfoCenter | DB2 Data Types
dW | DB2 and Ruby on Rails, Part 1 (May 2007)
dW | An Introduction to Ruby on Rails for DB2 Developers (June 2006)

The DB2 adapter is now called ibm_db. You can refresh your installation by typing gem install ibm_db at the command line and choosing the latest win32 release.

No implementation defined for org.apache.commons.logging.LogFactory

While writing a DB2 stored procedure that invoked a SOAP/WSDL web service using Apache Axis as part of WSIF, I ran into this doozie:

Ultimately, it’s caused by a too restrictive lib/security/java.policy file that ships with DB2.

Wrong Solution

The standard way to define an implementation is to create the following commons-logging.properties file and place it anywhere in your CLASSPATH (such as the root of a JAR file):

Alternatively, you can set the org.apache.commons.logging.Log configuration attribute for LogFactory programmatically.

Right Solution

Solution: Running an Axis SOAP client in Domino [or DB2]

My DB2 is installed into C:\Program Files\IBM\SQLLIB

1. Copy all your JARs to C:\Program Files\IBM\SQLLIB\java\jdk\jre\lib\ext
2. Open C:\Program Files\IBM\SQLLIB\java\jdk\jre\lib\security\
3. Open java.policy
4. Add:

5. Restart DB2