KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > platform > database > DB2MainframePlatform


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.platform.database;
23
24 import java.io.StringWriter JavaDoc;
25
26 import oracle.toplink.essentials.expressions.ExpressionOperator;
27 import oracle.toplink.essentials.queryframework.ValueReadQuery;
28
29 /**
30  * <B>Purpose</B>: Provides DB2 Mainframe specific behaviour.<P>
31  * <B>Responsibilities</B>:
32  * <UL>
33  * <LI>Specialized CONCAT syntax
34  * </UL>
35  */

36 public class DB2MainframePlatform extends DB2Platform {
37
38     /**
39      * INTERNAL:
40      * Initialize any platform-specific operators
41      */

42     protected void initializePlatformOperators() {
43         super.initializePlatformOperators();
44
45         addOperator(ExpressionOperator.simpleLogicalNoParens(ExpressionOperator.Concat, "CONCAT"));
46     }
47
48     /**
49      * INTERNAL:
50      * Build the identity query for native sequencing.
51      */

52     public ValueReadQuery buildSelectQueryForNativeSequence() {
53         ValueReadQuery selectQuery = new ValueReadQuery();
54         StringWriter JavaDoc writer = new StringWriter JavaDoc();
55         writer.write("SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1");
56
57         selectQuery.setSQLString(writer.toString());
58         return selectQuery;
59     }
60 }
61
Popular Tags