001: /*
002: * Created on Jul 3, 2004
003: *
004: * To change the template for this generated file go to
005: * Window>Preferences>Java>Code Generation>Code and Comments
006: */
007: package com.pk;
008:
009: import java.sql.Connection;
010: import java.sql.SQLException;
011: import java.util.Vector;
012:
013: /**
014: * @author Isabelle
015: *
016: * To change the template for this generated type comment go to
017: * Window>Preferences>Java>Code Generation>Code and Comments
018: */
019: public class DefaultDialect implements DatabaseDialect {
020:
021: /* (non-Javadoc)
022: * @see com.pk.DatabaseDialect#getKeywords()
023: */
024: public Vector getKeywords() {
025:
026: Vector keywords = new Vector();
027: keywords.add("add");
028: keywords.add("all");
029: keywords.add("alter");
030: keywords.add("analyze");
031: keywords.add("and");
032: keywords.add("as");
033: keywords.add("asc");
034: keywords.add("asensitive");
035: keywords.add("auto_increment");
036: keywords.add("bdb");
037: keywords.add("before");
038: keywords.add("berkeleydb");
039: keywords.add("between");
040: keywords.add("both");
041: keywords.add("by");
042: keywords.add("call");
043: keywords.add("cascade");
044: keywords.add("case");
045: keywords.add("change");
046: keywords.add("check");
047: keywords.add("collate");
048: keywords.add("column");
049: keywords.add("columns");
050: keywords.add("condition");
051: keywords.add("constraint");
052: keywords.add("create");
053: keywords.add("cross");
054: keywords.add("cursor");
055: keywords.add("database");
056: keywords.add("databases");
057: keywords.add("dec");
058: keywords.add("declare");
059: keywords.add("default");
060: keywords.add("delete");
061: keywords.add("desc");
062: keywords.add("describe");
063: keywords.add("deterministic");
064: keywords.add("distinct");
065: keywords.add("distinctrow");
066: keywords.add("div");
067: keywords.add("drop");
068: keywords.add("else");
069: keywords.add("elseif");
070: keywords.add("enclosed");
071: keywords.add("escaped");
072: keywords.add("exists");
073: keywords.add("explain");
074: keywords.add("false");
075: keywords.add("fetch");
076: keywords.add("fields");
077: keywords.add("for");
078: keywords.add("force");
079: keywords.add("foreign");
080: keywords.add("found");
081: keywords.add("from");
082: keywords.add("fulltext");
083: keywords.add("grant");
084: keywords.add("group");
085: keywords.add("having");
086: keywords.add("if");
087: keywords.add("ignore");
088: keywords.add("in");
089: keywords.add("index");
090: keywords.add("infile");
091: keywords.add("inner");
092: keywords.add("insert");
093: keywords.add("into");
094: keywords.add("is");
095: keywords.add("iterate");
096: keywords.add("join");
097: keywords.add("key");
098: keywords.add("keys");
099: keywords.add("leading");
100: keywords.add("left");
101: keywords.add("like");
102: keywords.add("like");
103: keywords.add("lock");
104: keywords.add("not");
105: keywords.add("null");
106: keywords.add("on");
107: keywords.add("optimize");
108: keywords.add("or");
109: keywords.add("order");
110: keywords.add("outer");
111: keywords.add("primary");
112: keywords.add("rename");
113: keywords.add("replace");
114: keywords.add("right");
115: keywords.add("select");
116: keywords.add("set");
117: keywords.add("show");
118: keywords.add("starting");
119: keywords.add("table");
120: keywords.add("then");
121: keywords.add("to");
122: keywords.add("trailing");
123: keywords.add("true");
124: keywords.add("union");
125: keywords.add("unique");
126: keywords.add("update");
127: keywords.add("use");
128: keywords.add("values");
129: keywords.add("when");
130: keywords.add("where");
131: keywords.add("while");
132: keywords.add("with");
133: keywords.add("verbose");
134:
135: return keywords;
136: }
137:
138: /* (non-Javadoc)
139: * @see com.pk.DatabaseDialect#getTableInfoSQLString(java.lang.String, com.pk.ConnectionInformation)
140: */
141: public String getTableInfoSQLString(String argTableName,
142: ConnectionInformation argConnectionInformation) {
143:
144: return null;
145: }
146:
147: /* (non-Javadoc)
148: * @see com.pk.DatabaseDialect#getIndexInfoSQLString(java.lang.String, com.pk.ConnectionInformation)
149: */
150: public String getIndexInfoSQLString(String argTableName,
151: ConnectionInformation argConnectionInformation) {
152:
153: return null;
154: }
155:
156: /* (non-Javadoc)
157: * @see com.pk.DatabaseDialect#getProcedureInfoSQLString(java.lang.String, com.pk.ConnectionInformation)
158: */
159: public String getProcedureInfoSQLString(String argProcedureName,
160: ConnectionInformation argConnectionInformation) {
161:
162: return null;
163: }
164:
165: /* (non-Javadoc)
166: * @see com.pk.DatabaseDialect#isSelectStatement(java.lang.String)
167: */
168: public boolean isSelectStatement(String argStatement) {
169: boolean isSelect = false;
170: if (argStatement.toUpperCase().startsWith("SELECT")
171: || argStatement.toUpperCase().startsWith("SHOW")
172: || argStatement.toUpperCase().startsWith("DESC")
173: || argStatement.toUpperCase().startsWith("EXPLAIN")) {
174: isSelect = true;
175: }
176: return isSelect;
177: }
178:
179: /* (non-Javadoc)
180: * @see com.pk.DatabaseDialect#isDescribeStatement(java.lang.String)
181: */
182: public boolean isDescribeStatement(String argStatement) {
183:
184: return false;
185: }
186:
187: /* (non-Javadoc)
188: * @see com.pk.DatabaseDialect#getDescribeSQLString(java.lang.String, com.pk.ConnectionInformation)
189: */
190: public String getDescribeSQLString(String argQuery,
191: ConnectionInformation argConnectionInformation) {
192:
193: return null;
194: }
195:
196: /* (non-Javadoc)
197: * @see com.pk.DatabaseDialect#doExecutePlan(java.lang.String, com.pk.ConnectionInformation, java.sql.Connection)
198: */
199: public String doExecutePlan(String argStatement,
200: ConnectionInformation argConnectionInformation,
201: Connection argConnection) throws SQLException {
202: return null;
203:
204: }
205:
206: /* (non-Javadoc)
207: * @see com.pk.DatabaseDialect#getPackageInfoSQLString(java.lang.String, com.pk.ConnectionInformation)
208: */
209: public String getPackageInfoSQLString(String argProcedureName,
210: ConnectionInformation argConnectionInformation) {
211: return null;
212: }
213:
214: }
|