View Javadoc

1   package org.apache.torque.adapter;
2   
3   /*
4    * Copyright 2001-2005 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License")
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  /***
20   * Torque Database Adapter for DB2/400 on the IBM AS400 platform.
21   *
22   * @author <a href="mailto:sweaver@rippe.com">Scott Weaver</a>
23   * @author <a href="mailto:vido@ldh.org">Augustin Vidovic</a>
24   * @version $Id: DBDB2400.java 239630 2005-08-24 12:25:32Z henning $
25   */
26  public class DBDB2400 extends DBDB2App
27  {
28     /***
29      * UpperCase/IgnoreCase sql function in DB2/400
30      */
31     public static final String UCASE = "UCASE";
32  
33  
34      /***
35       * DBDB2400 constructor.
36       */
37      protected DBDB2400()
38      {
39          super();
40      }
41  
42      /***
43       * This method is used to ignore case.
44       *
45       * @param in The string whose case to ignore.
46       * @return The string in a case that can be ignored.
47       */
48      public String ignoreCase(String in)
49      {
50          String s = formatCase(in);
51          return s;
52      }
53  
54      /***
55       * This method is used to ignore case.
56       *
57       * @param in The string to transform to upper case.
58       * @return The upper case string.
59       */
60      public String toUpperCase(String in)
61      {
62          String s = formatCase(in);
63          return s;
64      }
65  
66      /***
67       * Convenience method for String-formatting
68       * upper/ignore case statements.
69       *
70       * @param in The string to transform to upper case.
71       * @return The upper case string.
72       */
73      private String formatCase(String in)
74      {
75          return new StringBuffer(UCASE + "(").append(in).append(")").toString();
76      }
77  
78      /***
79       * This method is used to check whether the database supports
80       * limiting the size of the resultset.
81       *
82       * @return LIMIT_STYLE_DB2.
83       */
84      public int getLimitStyle()
85      {
86          return DB.LIMIT_STYLE_DB2;
87      }
88  }