package com.quantum.adapters;
-import com.quantum.sql.SQLHelper;
+import java.util.HashMap;
+import java.util.Map;
+
public class DB2Adapter extends DatabaseAdapter {
/**
super(AdapterFactory.DB2);
}
public String getShowTableQuery(String qualifier) {
- return "SELECT TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='T'"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "SELECT tabschema, TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='T'"; //$NON-NLS-1$ //$NON-NLS-2$
}
public String getShowViewQuery(String qualifier) {
- return "SELECT TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='V'"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "SELECT tabschema, TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='V'"; //$NON-NLS-1$ //$NON-NLS-2$
}
public String getShowSequenceQuery(String qualifier) {
- return "SELECT SEQNAME FROM sysibm.syssequences WHERE seqschema = '" + qualifier.toUpperCase() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "SELECT seqschema, SEQNAME FROM sysibm.syssequences WHERE seqschema = '" + qualifier.toUpperCase() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
}
public String getNextValue(String sequence, String owner) {
- return "VALUES NEXTVAL FOR " + SQLHelper.getQualifiedName(owner, sequence); //$NON-NLS-1$
+ return "VALUES NEXTVAL FOR " + getQualifiedName(owner, sequence); //$NON-NLS-1$
}
public String getPrevValue(String sequence, String owner) {
- return "VALUES PREVVAL FOR " + SQLHelper.getQualifiedName(owner, sequence); //$NON-NLS-1$
+ return "VALUES PREVVAL FOR " + getQualifiedName(owner, sequence); //$NON-NLS-1$
+ }
+ public Map getDefaultConnectionParameters() {
+ Map map = new HashMap();
+ // the standard driver doesn't use these values, but other drivers might...
+ map.put("port", "50000");
+ map.put("hostname", "localhost");
+ return map;
}
}