db2flywaydb2-400schema-migration

flyway, added additional JDBC driver, still getting "No database found to handle"


The driver in question is jt400.jar; I copied it to the driver directory of my flyway installation. This is the content of the file flyway.config in my project directory:

flyway.locations=filesystem:.
flyway.url=jdbc:as400://192.168.1.1/myschema;naming=system;errors=full
flyway.user=myschema
flyway.password=***

Calling flyway in my project directory produces the error:

No database found to handle jdbc:as400://192.168.1.1/myschema;naming=system;errors=full

With networking debug tools I checked that it didn't even try to establish the connection to the db, so the problem should be the driver.

Calling flyway with -X option to get more detail for the error, i get the following:

PS C:\Users\alex\Documents\myprj> flyway migrate -X
DEBUG: Loading config file: C:\Program Files\Red Gate\Flyway Desktop\flyway\conf\flyway.conf
DEBUG: Unable to load config file: C:\Users\alex\flyway.conf
DEBUG: Loading config file: C:\Users\alex\Documents\myprj\flyway.conf
DEBUG: Using configuration:
DEBUG: flyway.driver -> com.ibm.as400.access.AS400JDBCDriver
DEBUG: flyway.jarDirs -> C:\Program Files\Red Gate\Flyway Desktop\flyway\jars
DEBUG: flyway.locations -> filesystem:.
DEBUG: flyway.password -> ***
DEBUG: flyway.url -> jdbc:as400://192.168.1.1/myschema;naming=system;errors=full
DEBUG: flyway.user -> myschema
ERROR: Unexpected error
org.flywaydb.core.api.FlywayException: No database found to handle jdbc:as400://192.168.1.1/myschema;naming=system;errors=full
        at org.flywaydb.core.internal.database.DatabaseTypeRegister.getDatabaseTypeForUrl(DatabaseTypeRegister.java:441)
        at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:496)
        at org.flywaydb.core.internal.jdbc.DriverDataSource.<init>(DriverDataSource.java:476)
        at org.flywaydb.core.api.configuration.ClassicConfiguration.configure(ClassicConfiguration.java:2062)
        at org.flywaydb.core.api.configuration.FluentConfiguration.configuration(FluentConfiguration.java:1341)
        at org.flywaydb.commandline.Main.getLegacyConfiguration(Main.java:675)
        at org.flywaydb.commandline.Main.main(Main.java:509)

I tried to add an explicit reference to my driver class adding the following line to flyway.conf:

flyway.driver=com.ibm.as400.access.AS400JDBCDriver

The result is the same.


Solution

  • Currently you cannot use flyway with i-series (as400) as there is no published code for that purpose. Flyway at currently documented versions only supports the Db2-LUW variant of Db2 (Linux/Unix/Windows).

    You are free to write your own module to support the i-series, or pay others to do that.