1 package com.quantum.adapters;
3 import com.quantum.sql.SQLHelper;
5 public class DB2Adapter extends DatabaseAdapter {
9 protected DB2Adapter() {
10 super(AdapterFactory.DB2);
12 public String getShowTableQuery(String qualifier) {
13 return "SELECT TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='T'"; //$NON-NLS-1$ //$NON-NLS-2$
15 public String getShowViewQuery(String qualifier) {
16 return "SELECT TABNAME FROM syscat.tables WHERE tabschema = '" + qualifier.toUpperCase() + "' AND TYPE='V'"; //$NON-NLS-1$ //$NON-NLS-2$
18 public String getShowSequenceQuery(String qualifier) {
19 return "SELECT SEQNAME FROM sysibm.syssequences WHERE seqschema = '" + qualifier.toUpperCase() + "'"; //$NON-NLS-1$ //$NON-NLS-2$
21 public String getNextValue(String sequence, String owner) {
22 return "VALUES NEXTVAL FOR " + SQLHelper.getQualifiedName(owner, sequence); //$NON-NLS-1$
24 public String getPrevValue(String sequence, String owner) {
25 return "VALUES PREVVAL FOR " + SQLHelper.getQualifiedName(owner, sequence); //$NON-NLS-1$