Take the 2-minute tour ×

Is there a way of having liquibase call a custom Java class/plugin and giving that class access to the underlying connection to make data changes. I had a look but it only

So of our update steps require extensive data manipulation which is far far easier to do and debug in code than using SQL. So I would want to write tasks that can extract, transform and save data. Is that possible within the liquibase framework?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

If you are using a subclass of Change using the extension framework (liquibase.org/extensions) the generateStatements() method is passed the Database object the change is being executed against. Calling

((JdbcConnection) Database.getConnection()).getUnderlyingConnection() 

will return the java.sql.Connection used.

If you are using the CustomTaskChange interface, the execute() method that is executed is passed the same Database object you can get the connection from.

share|improve this answer

Your Answer


