1 package org.apache.torque.adapter;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 /***
32 * Serial version
33 */
34 private static final long serialVersionUID = -6185644296549139007L;
35
36 /***
37 * UpperCase/IgnoreCase sql function in DB2/400
38 */
39 public static final String UCASE = "UCASE";
40
41
42 /***
43 * DBDB2400 constructor.
44 */
45 protected DBDB2400()
46 {
47 super();
48 }
49
50 /***
51 * This method is used to ignore case.
52 *
53 * @param in The string whose case to ignore.
54 * @return The string in a case that can be ignored.
55 */
56 public String ignoreCase(String in)
57 {
58 String s = formatCase(in);
59 return s;
60 }
61
62 /***
63 * This method is used to ignore case.
64 *
65 * @param in The string to transform to upper case.
66 * @return The upper case string.
67 */
68 public String toUpperCase(String in)
69 {
70 String s = formatCase(in);
71 return s;
72 }
73
74 /***
75 * Convenience method for String-formatting
76 * upper/ignore case statements.
77 *
78 * @param in The string to transform to upper case.
79 * @return The upper case string.
80 */
81 private String formatCase(String in)
82 {
83 return new StringBuffer(UCASE + "(").append(in).append(")").toString();
84 }
85 }