1 package net.sourceforge.phpdt.sql.adapters;
3 public abstract class DatabaseAdapter {
4 public abstract DatabaseAdapter getInstance();
5 public abstract String getShowTableQuery(DatabaseInfo info);
6 public String getShowViewQuery(DatabaseInfo info) {
7 throw new FeatureNotSupported("Views");
9 public String getShowSequenceQuery(DatabaseInfo info) {
10 throw new FeatureNotSupported("Sequences");
12 public final String getShowTableQuery(DatabaseInfo info, String table) {
13 String schema = info.getSchema();
14 if (schema.equals("")) {
15 return "SELECT * FROM " + table;
17 return "SELECT * FROM " + info.getSchema() + "." + table;
20 public final String getTableCountQuery(DatabaseInfo info, String table) {
21 String schema = info.getSchema();
22 if (schema.equals("")) {
23 return "SELECT COUNT(*) FROM " + table;
25 return "SELECT COUNT(*) FROM " + info.getSchema() + "." + table;
28 public String getNextValue(String sequence) {
29 throw new FeatureNotSupported("Sequences");
31 public String getTableListFilter() {