DatabaseConnection 1.9.5 vs 2.0.3

Hi all,

We are migrating from 1.9.3 to 2.0.3.

In 1.9.5 we could get java.sql.Statement from the liquibase.database.DatabaseConnection class, i.e. databaseConnection.createStatement();

In 1.9.5 we could also get a liquibase.database.template.JdbcTemplate from the liquibase.database.Database class.

This was quite handy.

How can I accomplish this in Liquibase 2.0.3. Have searched quite a lot through the javadoc but without success.

Could someone please guide me on this matter.

Best regards /Lasse Bergström

Looks like there’s been some refactoring going on since 1.9.5 and I am new to git - so its a bit hard to figure out which defects generated the changes.

You can call createStatement() on a JdbcConnection object, which implements the Database interface, but it looks like in the newer versions, createStatement was removed from the Database interface, but still exists in the implementation, like JdbcConnection.

It looks like the JdbcTemplate was removed because I don’t see that in the new code base at all.  Someone else may be able to answer that question.

If you cast DatbaseConnection as liquibase.database.jvm.JdbcConnection there is the createStatement() method and others. 

I believe the JdbcTemplace class has morphed into the Executor interface/JdbcExecutor implementation. You get an instance of Executor by calling ExecutorService.getInstance().getExecutor(database)