01: /*
02: * Copyright 2002 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: CloudscapeAdapter.java,v 1.4 2002/11/24 06:02:47 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo.store;
12:
13: import java.sql.DatabaseMetaData;
14:
15: /**
16: * Provides methods for adapting SQL language elements to the Cloudscape
17: * database.
18: *
19: * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
20: * @version $Revision: 1.4 $
21: *
22: * @see DatabaseAdapter
23: */
24:
25: class CloudscapeAdapter extends DatabaseAdapter {
26: /**
27: * Constructs an Cloudscape adapter based on the given JDBC metadata.
28: *
29: * @param metadata the database metadata.
30: */
31:
32: protected CloudscapeAdapter(DatabaseMetaData metadata) {
33: super (metadata);
34: }
35:
36: public String getVendorID() {
37: return "cloudscape";
38: }
39:
40: public boolean supportsDeferredConstraints() {
41: return false;
42: }
43:
44: public TableExpression newTableExpression(QueryStatement qs,
45: Table table, SQLIdentifier rangeVar) {
46: /*
47: * Syntactically Cloudscape can also handle TableExprAsJoins,
48: * but when I tried that style with Cloudscape 4.0 certain queries
49: * (like those involving EXISTS) failed with a message stating that
50: * no execution plan could be found, or some such.
51: */
52: return new TableExprAsSubquery(qs, table, rangeVar);
53: }
54:
55: public String getDropTableStatement(BaseTable table) {
56: return "DROP TABLE " + table.getName();
57: }
58: }
|