KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > dialect > DB2400Dialect


1 package org.hibernate.dialect;
2
3 /**
4 * An SQL dialect for DB2/400
5 * @author Peter DeGregorio (pdegregorio)
6 * This class provides support for DB2 Universal Database for iSeries,
7 * also known as DB2/400.
8 */

9 public class DB2400Dialect extends DB2Dialect {
10
11     public boolean supportsSequences() {
12         return false;
13     }
14
15     public String JavaDoc getIdentitySelectString() {
16         return "select identity_val_local() from sysibm.sysdummy1";
17     }
18
19     public boolean supportsLimit() {
20         return true;
21     }
22
23     public boolean supportsLimitOffset() {
24         return false;
25     }
26
27     public String JavaDoc getLimitString(String JavaDoc sql, int offset, int limit) {
28         return new StringBuffer JavaDoc(sql.length() + 40)
29             .append(sql)
30             .append(" fetch first ")
31             .append(limit)
32             .append(" rows only ")
33             .toString();
34     }
35
36     public boolean useMaxForLimit() {
37         return true;
38     }
39
40     public boolean supportsVariableLimit() {
41         return false;
42     }
43
44 }
Popular Tags