KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > store > CloudscapeAdapter


1 /*
2  * Copyright 2002 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: CloudscapeAdapter.java,v 1.4 2002/11/24 06:02:47 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.store;
12
13 import java.sql.DatabaseMetaData JavaDoc;
14
15
16 /**
17  * Provides methods for adapting SQL language elements to the Cloudscape
18  * database.
19  *
20  * @author <a HREF="mailto:mmartin5@austin.rr.com">Mike Martin</a>
21  * @version $Revision: 1.4 $
22  *
23  * @see DatabaseAdapter
24  */

25
26 class CloudscapeAdapter extends DatabaseAdapter
27 {
28     /**
29      * Constructs an Cloudscape adapter based on the given JDBC metadata.
30      *
31      * @param metadata the database metadata.
32      */

33
34     protected CloudscapeAdapter(DatabaseMetaData JavaDoc metadata)
35     {
36         super(metadata);
37     }
38
39     public String JavaDoc getVendorID()
40     {
41         return "cloudscape";
42     }
43
44     public boolean supportsDeferredConstraints()
45     {
46         return false;
47     }
48
49     public TableExpression newTableExpression(QueryStatement qs, Table table, SQLIdentifier rangeVar)
50     {
51         /*
52          * Syntactically Cloudscape can also handle TableExprAsJoins,
53          * but when I tried that style with Cloudscape 4.0 certain queries
54          * (like those involving EXISTS) failed with a message stating that
55          * no execution plan could be found, or some such.
56          */

57         return new TableExprAsSubquery(qs, table, rangeVar);
58     }
59
60     public String JavaDoc getDropTableStatement(BaseTable table)
61     {
62         return "DROP TABLE " + table.getName();
63     }
64 }
65
Popular Tags