When using the DB2 JCC (Java Common Connector) JDBC driver, you can enable trace by appending the following to your jdbc uri: :traceFile=c:\jcc.log;TraceLevel=TRACE_ALL;
You can also specify a schema in the jdbc:uri using :currentSchema=MySchema. Here's an example JDBC uri showing both in use for easy cut and pasting: jdbc:db2://192.168.0.2:50000/TestDB:currentSchema=MySchema;traceFile=C:/jcc.log;TraceLevel=TRACE_ALL;
Next onto Apache ddlutils. When using this library with DB2, be aware that when reading a model from DB2, the provided DB2ModelReader does not either a default schema or a default catalogue pattern. The combination of the default behaviour in ddlutils which is to read out the existing database before writing it back out and also creating your new tables provided in your Torque formatted XML, with a null default scheme results in ddlutils reading out not only your user tables (desired behaviour) but also the DB2 catalogue (undesirable!). This caused me a headache because the ddlutils model couldn't hack a default DB2 9.7 install in it's entirety.
You can work around this in 2 ways:
1) Set the property alterdatabase="false" on your <writeSchemaToDatabase> tag (this prevents the model being read).
2) Update the source code to include setting the default schema to something other than null.
Finally, a little nugget on Liferay in conjunction with ddlutils. Liferay seems to use some database tables which have table names ending in an underscore. Unfortunately, underscore is the single character wildcard in SQL so when ddlutils tries to systematically read out the entire database by inspection SELECT * FROM contact_ can result in you getting fields returned from both the contact_ table and also the contacts table, which then causes other grief. I think the underscores were probably used to prevent clashes with user tables or reserved words, but unfortunately clashes is exactly what they ended up causing.