Skip to content

Commit

Permalink
0002754: iSeries can't detect sym tables on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Aug 26, 2016
1 parent 94245ff commit 95503b9
Showing 1 changed file with 14 additions and 5 deletions.
Expand Up @@ -2,6 +2,7 @@

import javax.sql.DataSource;

import org.apache.commons.lang.StringUtils;
import org.jumpmind.db.sql.SqlTemplateSettings;

public class Db2As400DatabasePlatform extends Db2DatabasePlatform {
Expand All @@ -20,11 +21,19 @@ protected Db2DdlBuilder createDdlBuilder() {
return new Db2As400DdlBuilder();
}

public String getDefaultCatalog() {
return "";
}

public String getDefaultSchema() {
return "";
if (StringUtils.isBlank(defaultSchema)) {
try {
defaultSchema = (String) getSqlTemplate().queryForObject("select CURRENT SCHEMA from sysibm.sysdummy1", String.class);
} catch (Exception e) {
try {
defaultSchema = (String) getSqlTemplate().queryForObject("select CURRENT SCHEMA from QSYS2.QSQPTABL", String.class);
} catch(Exception ex) {
defaultSchema = "";
}
}
}
return defaultSchema;
}

}

0 comments on commit 95503b9

Please sign in to comment.