1 package org.apache.torque.adapter;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.sql.Connection;
20 import java.sql.SQLException;
21
22 /***
23 * This is used to connect via the Application-Driver to DB2
24 * databases.
25 *
26 * <a href="http://www-4.ibm.com/software/data/db2/">
27 * http://www-4.ibm.com/software/data/db2/
28 * </a>
29 *
30 * @author <a href="mailto:hakan42@gmx.de">Hakan Tandogan</a>
31 * @version $Id: DBDB2App.java,v 1.7 2004/08/06 12:14:15 seade Exp $
32 */
33 public class DBDB2App extends DB
34 {
35 /***
36 * Empty constructor.
37 */
38 protected DBDB2App()
39 {
40 }
41
42 /***
43 * This method is used to ignore case.
44 *
45 * @param in The string to transform to upper case.
46 * @return The upper case string.
47 */
48 public String toUpperCase(String in)
49 {
50 String s = new StringBuffer("UPPER(").append(in).append(")").toString();
51 return s;
52 }
53
54 /***
55 * This method is used to ignore case.
56 *
57 * @param in The string whose case to ignore.
58 * @return The string in a case that can be ignored.
59 */
60 public String ignoreCase(String in)
61 {
62 String s = new StringBuffer("UPPER(").append(in).append(")").toString();
63 return s;
64 }
65
66 /***
67 * @see org.apache.torque.adapter.DB#getIDMethodType()
68 */
69 public String getIDMethodType()
70 {
71 return NO_ID_METHOD;
72 }
73
74 /***
75 * @see org.apache.torque.adapter.DB#getIDMethodSQL(Object obj)
76 */
77 public String getIDMethodSQL(Object obj)
78 {
79 return null;
80 }
81
82 /***
83 * Locks the specified table.
84 *
85 * @param con The JDBC connection to use.
86 * @param table The name of the table to lock.
87 * @exception SQLException No Statement could be created or executed.
88 */
89 public void lockTable(Connection con, String table) throws SQLException
90 {
91 }
92
93 /***
94 * Unlocks the specified table.
95 *
96 * @param con The JDBC connection to use.
97 * @param table The name of the table to unlock.
98 * @exception SQLException No Statement could be created or executed.
99 */
100 public void unlockTable(Connection con, String table) throws SQLException
101 {
102 }
103
104 /***
105 * This method is used to check whether the database supports
106 * limiting the size of the resultset.
107 *
108 * @return LIMIT_STYLE_DB2.
109 */
110 public int getLimitStyle()
111 {
112 return DB.LIMIT_STYLE_DB2;
113 }
114 }