Fix issue where DB2 queries are not selected correctly.
Fix:
@@ -4869,48 +4869,44 @@ public class ApplicationDAOImpl extends AbstractApplicationDAOImpl implements Pa
private String getDBVendorSpecificDiscoverableAppRetrievalQueryByAppName(String dbVendorType) throws
IdentityApplicationManagementException {
- switch (dbVendorType) {
- case "MySQL":
- case "H2":
+ if ("MySQL".equals(dbVendorType) || "H2".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_MYSQL;
- case "Oracle":
+ } else if ("Oracle".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_ORACLE;
- case "Microsoft SQL Server":
+ } else if ("Microsoft SQL Server".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_MSSQL;
- case "PostgreSQL":
+ } else if ("PostgreSQL".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_POSTGRESQL;
- case "DB2":
+ } else if (dbVendorType != null && dbVendorType.contains("DB2")) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_DB2;
- case "INFORMIX":
+ } else if ("INFORMIX".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_AND_APP_NAME_INFORMIX;
- default:
+ }
+
throw new IdentityApplicationManagementException("Error while loading discoverable applications from " +
"DB. Database driver for " + dbVendorType + "could not be identified or not supported.");
}
- }
private String getDBVendorSpecificDiscoverableAppRetrievalQuery(String dbVendorType) throws
IdentityApplicationManagementException {
- switch (dbVendorType) {
- case "MySQL":
- case "H2":
+ if ("MySQL".equals(dbVendorType) || "H2".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_MYSQL;
- case "Oracle":
+ } else if ("Oracle".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_ORACLE;
- case "Microsoft SQL Server":
+ } else if ("Microsoft SQL Server".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_MSSQL;
- case "PostgreSQL":
+ } else if ("PostgreSQL".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_POSTGRESQL;
- case "DB2":
+ } else if (dbVendorType != null && dbVendorType.contains("DB2")) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_DB2SQL;
- case "INFORMIX":
+ } else if ("INFORMIX".equals(dbVendorType)) {
return LOAD_DISCOVERABLE_APPS_BY_TENANT_INFORMIX;
- default:
+ }
+
throw new IdentityApplicationManagementException("Error while loading discoverable applications from " +
"DB. Database driver for " + dbVendorType + "could not be identified or not supported.");
}
- }
private ApplicationBasicInfo buildApplicationBasicInfo(ResultSet appNameResultSet)
throws SQLException {
