Liquibase seems to ignore 'currentSchema' property in JDBC URL when generating DB2 changeLog


I’m trying to use Liquibase to extract the DDL from a DB2 Database. The Database has several schemas (say A, B, C, D, E) but the user I have to log in with is not the owner of any of those schemas (although they do have the appropriate grants to access them).

General internet wisdom suggested that suffixing the JDBC url with :currentSchema=; should work but when I try this Liquibase still seems to use the connecting user’s default schema.

For reference here is the full command I am using (in this example I am trying to set the currentSchema to EM3:

./liquibase \ --classpath=/usr/local/java/maven-repository/com/ibm/db2/db2jcc/9.7.1/db2jcc-9.7.1.jar \ --changeLogFile=em3db.xml \ --url=“jdbc:db2://;” \ --username=em3appdb \ --password=thisisobviouslynottherealpassword \ generateChangeLog

Has anyone managed to get this working? If not is it worth me raising as a bug in JIRA? I’d be happy to see if I can make time to write a patch if someone could point me in the right direction in terms of code areas to look at.



Experiencing the same problem.  I’m trying to do a changelogSync.  Liquibase creates both tables, but fails to release the lock.  If anyone has got this working, would appreciate the help. 

This is still an issue.  Using version 2.0.5 of Liquibase.  Any chance on getting it fixed or finding another work around?

I found a workaround myself.  Instead of using the currentSchema property on the JDBC url, I started using the -currentSchema option on the command line.  Works as expected now.

Could you provide an example of how you’re doing this? Are you setting it as a system property on the command line?

e.g. -DcurrentSchema=someSchema?

Many thanks,

Specifies the default schema to use for managed database objects and for Liquibase control tables