4.  IBM DB2

4.1. Known issues with DB2

Example 2.4.  Example properties for IBM DB2

openjpa.ConnectionDriverName: com.ibm.db2.jcc.DB2Driver
openjpa.ConnectionURL: jdbc:db2://SERVER_NAME:SERVER_PORT/DB_NAME

4.1.  Known issues with DB2

  • Floats and doubles may lose precision when stored.

  • Empty char values are stored as NULL.

  • Fields of type BLOB and CLOB are limited to 1M. This number can be increased by extending DB2Dictionary.

  • Explicit creation of indexes specified by the OpenJPA @Index annotation will fail on DB2 for iSeries if the default schema used by the JDBC driver does not exist. If a default schema is not specified on the connection, the iSeries will default to the user profile name. If a schema of that name does not exist, DB2 on iSeries will not create the schema, resulting in a failure when creating the index. The failure message will look similar to: "[SQL0204] USERNAME in QSYS type *LIB not found." To work around this issue, specify a default schema on the JDBC URL or data source property and make sure that schema exists or create a schema which matches the user profile of the connection.