01: package org.apache.torque.adapter;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
20: */
21:
22: /**
23: * Torque Database Adapter for DB2/400 on the IBM AS400 platform.
24: *
25: * @author <a href="mailto:sweaver@rippe.com">Scott Weaver</a>
26: * @author <a href="mailto:vido@ldh.org">Augustin Vidovic</a>
27: * @version $Id: DBDB2400.java 473821 2006-11-11 22:37:25Z tv $
28: */
29: public class DBDB2400 extends DBDB2App {
30: /**
31: * Serial version
32: */
33: private static final long serialVersionUID = -6185644296549139007L;
34:
35: /**
36: * UpperCase/IgnoreCase sql function in DB2/400
37: */
38: public static final String UCASE = "UCASE";
39:
40: /**
41: * DBDB2400 constructor.
42: */
43: protected DBDB2400() {
44: super ();
45: }
46:
47: /**
48: * This method is used to ignore case.
49: *
50: * @param in The string whose case to ignore.
51: * @return The string in a case that can be ignored.
52: */
53: public String ignoreCase(String in) {
54: String s = formatCase(in);
55: return s;
56: }
57:
58: /**
59: * This method is used to ignore case.
60: *
61: * @param in The string to transform to upper case.
62: * @return The upper case string.
63: */
64: public String toUpperCase(String in) {
65: String s = formatCase(in);
66: return s;
67: }
68:
69: /**
70: * Convenience method for String-formatting
71: * upper/ignore case statements.
72: *
73: * @param in The string to transform to upper case.
74: * @return The upper case string.
75: */
76: private String formatCase(String in) {
77: return new StringBuffer(UCASE + "(").append(in).append(")")
78: .toString();
79: }
80: }
|