diff --git a/org.talend.metadata.managment/src/main/java/org/talend/core/model/metadata/DBConnectionFillerImpl.java b/org.talend.metadata.managment/src/main/java/org/talend/core/model/metadata/DBConnectionFillerImpl.java index 8894e74772..22e6567219 100644 --- a/org.talend.metadata.managment/src/main/java/org/talend/core/model/metadata/DBConnectionFillerImpl.java +++ b/org.talend.metadata.managment/src/main/java/org/talend/core/model/metadata/DBConnectionFillerImpl.java @@ -399,15 +399,20 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl { catalogName = ""; //$NON-NLS-1$ } } - // MOD xqliu 2010-03-03 feature 11412 - if (!isNullSID(dbConn) && dbConn != null) { - String databaseOnConnWizard = ((DatabaseConnection) dbConn).getSID(); - // If the SID on ui is not empty, the catalog name should be same to this SID name. - postFillCatalog(metaConnection, catalogList, filterList, - TalendCWMService.getReadableName(dbConn, databaseOnConnWizard), dbConn); - break; - } else if (isCreateElement(catalogFilter, catalogName)) { - postFillCatalog(metaConnection, catalogList, filterList, catalogName, dbConn); + // Changed by Marvin Wang on Jan. 6, 2012 for bug TDI-24222. I haved discussed with Shen Ze about + // the fix,it is okay for them. What we did is to avoid creating a new catalog when catalogName is + // "null" for DB2. + if (catalogName != null) { + // MOD xqliu 2010-03-03 feature 11412 + if (!isNullSID(dbConn) && dbConn != null) { + String databaseOnConnWizard = ((DatabaseConnection) dbConn).getSID(); + // If the SID on ui is not empty, the catalog name should be same to this SID name. + postFillCatalog(metaConnection, catalogList, filterList, + TalendCWMService.getReadableName(dbConn, databaseOnConnWizard), dbConn); + break; + } else if (isCreateElement(catalogFilter, catalogName)) { + postFillCatalog(metaConnection, catalogList, filterList, catalogName, dbConn); + } } // ~11412 } @@ -880,7 +885,7 @@ public class DBConnectionFillerImpl extends MetadataFillerImpl { } } } else if (dbJDBCMetadata.getDatabaseProductName() != null - && dbJDBCMetadata.getDatabaseProductName().equals("DB2/NT")) { //$NON-NLS-1$ + && dbJDBCMetadata.getDatabaseProductName().startsWith("DB2/NT")) { //$NON-NLS-1$ for (String element : tableType) { if (element.equals("SYNONYM")) { //$NON-NLS-1$ Statement stmt = ExtractMetaDataUtils.conn.createStatement();