1 package com.quantum.adapters;
3 import java.util.HashMap;
7 public class DB2Adapter extends DatabaseAdapter {
11 protected DB2Adapter() {
12 super(AdapterFactory.DB2);
14 public String getShowTableQuery(String qualifier) {
15 return "SELECT tabschema, TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='T'"; //$NON-NLS-1$ //$NON-NLS-2$
17 public String getShowViewQuery(String qualifier) {
18 return "SELECT tabschema, TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='V'"; //$NON-NLS-1$ //$NON-NLS-2$
20 public String getShowSequenceQuery(String qualifier) {
21 return "SELECT seqschema, SEQNAME FROM sysibm.syssequences WHERE seqschema = '" + qualifier.toUpperCase() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
23 public String getNextValue(String sequence, String owner) {
24 return "VALUES NEXTVAL FOR " + getQualifiedName(owner, sequence); //$NON-NLS-1$
26 public String getPrevValue(String sequence, String owner) {
27 return "VALUES PREVVAL FOR " + getQualifiedName(owner, sequence); //$NON-NLS-1$
29 public Map getDefaultConnectionParameters() {
30 Map map = new HashMap();
31 // the standard driver doesn't use these values, but other drivers might...
32 map.put("port", "50000");
33 map.put("hostname", "localhost");