Merge pull request #4118 from mdeinum/gh-4115

* pr/4118:
  Polish
  Added support for the DB2 AS400 Driver
pull/4140/head
Stephane Nicoll 9 years ago
commit 3cabca7db4

@ -207,6 +207,14 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator
},
DB2_AS400("DB2 UDB for AS/400", "SELECT 1 FROM SYSIBM.SYSDUMMY1") {
@Override
protected boolean matchesProduct(String product) {
return super.matchesProduct(product)
|| product.toLowerCase().contains("as/400");
}
},
INFORMIX("Informix Dynamic Server", "select count(*) from systables"),
FIREBIRD("Firebird", "SELECT 1 FROM RDB$DATABASE") {

@ -1,5 +1,5 @@
/*
* Copyright 2012-2014 the original author or authors.
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -116,6 +116,8 @@ public class DataSourceHealthIndicatorTests {
assertThat(Product.forProduct("Apache Derby"), equalTo(Product.DERBY));
assertThat(Product.forProduct("DB2"), equalTo(Product.DB2));
assertThat(Product.forProduct("DB2/LINUXX8664"), equalTo(Product.DB2));
assertThat(Product.forProduct("DB2 UDB for AS/400"), equalTo(Product.DB2_AS400));
assertThat(Product.forProduct("DB3 XDB fur AS/400"), equalTo(Product.DB2_AS400));
assertThat(Product.forProduct("Informix Dynamic Server"),
equalTo(Product.INFORMIX));
assertThat(Product.forProduct("Firebird 2.5.WI"), equalTo(Product.FIREBIRD));

@ -93,7 +93,12 @@ enum DatabaseDriver {
/**
* DB2 Server.
*/
DB2("com.ibm.db2.jcc.DB2Driver", "com.ibm.db2.jcc.DB2XADataSource");
DB2("com.ibm.db2.jcc.DB2Driver", "com.ibm.db2.jcc.DB2XADataSource"),
/**
* DB2 AS400 Server.
*/
AS400("com.ibm.as400.access.AS400JDBCDriver", "com.ibm.as400.access.AS400JDBCXADataSource");
private final String driverClassName;

Loading…
Cancel
Save