No database found to handle jdbc:as400://...
Agostino
Posts: 1 New member
I'm trying to configure flyway to connect to a DB2 iSeries.
I put the driver jar (jt400.jar) into flyway's drivers directory.
I wrote a flyway.config file with the following content in my project directory.
Same result.
I put the driver jar (jt400.jar) into flyway's drivers directory.
I wrote a flyway.config file with the following content in my project directory.
flyway.locations=filesystem:.
flyway.url=jdbc:as400://192.168.1.1/MYSCHEMA;naming=system;errors=full
flyway.driver=com.ibm.as400.access.AS400JDBCDriver
flyway.user=MYSCHEMA
flyway.password=*****************
I launched the flyway command from that directory, with the -X flag for gettin additional debug information.
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)
Using netstat I determined that it doesn't even try to connect to the db.
It seems that it can't associate the driver with my URL. I tried also omitting the following line in the flyway.config.
flyway.driver=com.ibm.as400.access.AS400JDBCDriver
Same result.
Tagged:
Answers
I'm sorry to say that flyway doesn't support the as400 flavour of DB2.
Looking at IBMs docs they had separate JDBC drivers and url definitions for the two different formats.
https://www.ibm.com/support/pages/db2-jdbc-driver-versions-and-downloads
vs
https://www.ibm.com/support/pages/using-jdbc-connector-connect-db2-iseries-as400
This would also align with the behaviour you described, while flyway can reach the driver, it doesn't know how to utilise it and no connection attempt is made.