Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

JDBC driver versions

If you get undefinably issues: Please check, if you use the correct driver that is shipped with the version from your DB2 server. DB2 is here a little bit pedantic and the client JDBC driver should match the server version.

There was also a change in the usage of getColumnLabel and getColumnName in the JDBC drivers version 4.0 and later.

This has e.g. impact for SQL queries with an alias for the fieldname like:

SELECT column AS aliasName from table

With JDBC drivers version 4.0 and later you will most likely not get the aliasName.

PDI-2905 is adressing this issue, see also http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.java/com.ibm.db2.luw.apdv.java.doc/doc/c0052593.htm
"[...] for JDBC and SQLJ version 4.0 and later, the default behavior of ResultSetMetaData.getColumnName and ResultSetMetaData.getColumnLabel differs from the default behavior for earlier JDBC drivers. You can use the useJDBC4ColumnNameAndLabelSemantics property to change this behavior."

At a test we were not able to change this behaviour by the property useJDBC4ColumnNameAndLabelSemantics and were not able to get the aliasName.
Also the behaviour is different depending on the operating system DB2 runs on.