Monday, 29 June 2009

Session sharing in Apache Tomcat

Share
Sometimes when you want to create large portal-like application which consists of a few smaller applications, or you want to create your own SSO domain, you must share session and session data between all interested applications.

Today I will show you how you can share session and data across applications in Apache Tomcat 6.

Monday, 22 June 2009

XMLPATTERN and generated XML indexes

Share
In IBM DB2 pureXML XML documents are stored in tree structures as string values.

XQueries are not efficient in such environment. To speed up access to certain nodes, especially those most frequently used, pureXML engine provides XML indexes mechanism. The features include:
  • generating indexes using XQuery statements
  • generating unique constraints
  • casting XML elements to IBM DB2 data types so indexes work much faster, for example, integer-based index 1234567 is much faster then equivalent string one "1234567"
Today I will show you how to create such indexes. I will use table and sample records which I showed you before in the First steps with IBM DB2 pureXML and XQuery post.

Monday, 15 June 2009

XQuery, JDBC and prepared statements

Share
Last time in First steps with IBM DB2 pureXML and XQuery post I showed you how to insert and retrieve XML documents using IBM DB2 Control Center and its Command Editor tool.

Today I will show you how to execute XML queries programmatically using JDBC API.

The easiest way to execute XML queries programmatically is simply to create a string literal and execute it using JDBC Statement interface.

But the problem is when you want to parameterised your query.

Of course, you can build string literals by concatenating SQL, XML, and parameters. But it's not a professional approach.

In this post I will show you the very same queries I showed you in First steps with IBM DB2 pureXML and XQuery post, but this time I will execute them using JDBC and PreparedStatement interface.

Monday, 8 June 2009

First steps with IBM DB2 pureXML and XQuery

Share
In this post I will show you the basics of XML support in IBM DB2 pureXML.

I assume you have IBM DB2 9.x installed on your machine and that you read my previous post about IBM DB2: My Master's Thesis and IBM DB2 pureXML.

IBM DB2 pureXML has revolutionized support for XML data in modern databases. In IBM
DB2 pureXML documents are stored in dedicated XML column type which preserves document's hierarchy and allows to traverse its contents with XPath queries.
IBM DB2 pureXML engine comes with three new query types:
  • SQL/XML with XQuery or XPath embedded in SQL statements - the broadest functionality and the least restrictions, supports both way mappings XML - relational data, passing parameters from relational columns to XML documents, dynamic casting and passing markers to XML queries

  • XQuery - can be used when applications require querying and manipulating XML data only

  • XQuery with embedded SQL - leverages relational predicates, indexes, and external functions on the XML columns
Today I will show you how to create tables with XML columns, how to insert XML documents, and how to retrieve them using basic XQueries.

Let's get down to XML business then!

Friday, 5 June 2009

My Master's Thesis and IBM DB2 pureXML

Share
Last Thursday I received a phone call from my University's deanery.

Woman who called me told me that I still hadn't collected my English diploma.

(I graduated from Gdańsk University of Technology 2 years ago in June 2007 :) ).

Then it struck me. I haven't written anything about IBM DB2 pureXML engine on my blog.

My Master's Thesis title is: Distributed system for gathering and analysing XML data.

The goal of my thesis was to design and implement distributed flexible framework which could efficiently acquire and validate XML data from the user.

It implements a user case of the Endoscopy Recommender System. System's business client was Gastrointestinal Endoscopy Clinic at Medical University of Gdańsk.

System is written in Java EE, uses JBoss/Apache Geronimo application servers and stores data in innovatory hybrid IBM DB2 pureXML DBMS engine.

When I find a nice PDF sharing site I will publish it and make it available to all of you.

In the upcoming weeks I will write some posts about IBM DB2 pureXML and its super cool XML support :)

Today, as a warm-up before true XML/XQuery/XPath test drive, I will show you the old school JDBC relational way of working with IBM DB2.

Monday, 1 June 2009

Don't use org.apache.maven.archetypes!

Share
Why? Simply because they are very outdated.

Of course I'm not talking about Maven plugins which of course support all latest versions of Java EE specs (web 2.5, ejb 3.0, ear 3.0).

I'm talking about Maven archetypes which create archaic project stubs...

How many times have you used maven-archetype-webapp and had to manually change web.xml to be web 2.5 compliant?

How many times have you used maven-archetype-quickstart and had to manually change pom.xml settings?

Have you ever used maven-archetype-j2ee-simple archetype? Try it. It's a stub of J2EE 1.3 application with few modules (including web module with empty web.xml file...).