01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.lucene.store.jdbc.dialect;
18:
19: /**
20: * A DB2 dialect.
21: *
22: * @author kimchy
23: */
24: public class DB2Dialect extends Dialect {
25:
26: /**
27: * DB2 supports select ... for update.
28: */
29: public boolean supportsForUpdate() {
30: return true;
31: }
32:
33: /**
34: * DB2 supports current timestamp selection.
35: */
36: public boolean supportsCurrentTimestampSelection() {
37: return true;
38: }
39:
40: public String getCurrentTimestampSelectString() {
41: return "values current timestamp";
42: }
43:
44: public boolean isCurrentTimestampSelectStringCallable() {
45: return false;
46: }
47:
48: public String getVarcharType(int length) {
49: return "varchar(" + length + ")";
50: }
51:
52: public String getBlobType(long length) {
53: return "blob(" + length + " K)";
54: }
55:
56: public String getNumberType() {
57: return "integer";
58: }
59:
60: public String getTimestampType() {
61: return "timestamp";
62: }
63:
64: public String getCurrentTimestampFunction() {
65: return "current_timestamp";
66: }
67:
68: public String getBitType() {
69: return "smallint";
70: }
71: }
|