-
Notifications
You must be signed in to change notification settings - Fork 221
/
Db2As400DatabasePlatform.java
39 lines (31 loc) · 1.16 KB
/
Db2As400DatabasePlatform.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package org.jumpmind.db.platform.db2;
import javax.sql.DataSource;
import org.apache.commons.lang.StringUtils;
import org.jumpmind.db.sql.SqlTemplateSettings;
public class Db2As400DatabasePlatform extends Db2DatabasePlatform {
public Db2As400DatabasePlatform(DataSource dataSource, SqlTemplateSettings settings) {
super(dataSource, settings);
}
@Override
protected Db2DdlReader createDdlReader() {
return new Db2As400DdlReader(this);
}
@Override
protected Db2DdlBuilder createDdlBuilder() {
return new Db2As400DdlBuilder();
}
public String getDefaultSchema() {
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;
}
}