OpenWGA 7.10 - OpenWGA Concepts and Features
Content Stores » PlatformsIBM DB2
IBM DB2 is an enterprise grade relational database platform of the IBM corporation.
Support for this server platform is only available on the OpenWGA Enterprise Edition.
OpenWGA supports content stores on DB2 servers of version 8.2 or higher.
Preparations
In order to connect to the DB2 server OpenWGA needs the DB2 JDBC driver called "Universal JDBC Driver", supporting JDBC 2 and 4 type connections. We will describe here the process of connecting via JDBC 4 type.
Put the JDBC driver JAR files into the classpath of your application server:
- When you have installed OpenWGA via official debian packages or linux installer just put driver files into the folder "/var/lib/openwga/tomcat/lib"
- If you used the official linux installer you can put them into "/opt/tomcat/lib"
- In OpenWGA Developer Studio just open the configuration of your runtime project by double-clicking the file "runtime.xml", go to register "configuration" and add the files there in section "Tomcat Libraries".
You should also add the following Java system property to the OpenWGA/Java server process:
hibernate.jdbc.use_streams_for_binary = true
- If you installed OpenWGA via official debian packages open the file "/etc/openwga/server.conf.local" and add " -Dhibernate.jdbc.use_streams_for_binary=true" to the end of the contents of variable CATALINA_OPTS which is defined there.
- If you used the official linux installer you will find the same variable defined in a file "/etc/tomcat.conf".
- In OpenWGA Developer Studio just open the configuration of your runtime project by double-clicking the file "runtime.xml", go to register "configuration" and add the entry as a new line into field "additional vm options".
After you added the driver JAR files and the system property you need to restart your OpenWGA server for the changes to be effective.
Queries
The data of text items in DB2 content stores are store in columns
of type CLOB. This data type cannot directly be used for SQL conditions,
so this is also not possible for HQL. Directly testing the contents of
item text values in SQL or HQL will therefor fail:
content.items['textitem'].text = 'value'
To query the contents of text items you need to convert it into VARCHAR using DB2 SQL function VARCHAR().:
VARCHAR(content.items['textitem'].text) = 'value'