KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > beanutils > TestResultSetMetaData


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17
18 package org.apache.commons.beanutils;
19
20
21 import java.sql.ResultSetMetaData JavaDoc;
22 import java.sql.SQLException JavaDoc;
23
24
25 /**
26  * <p>Mock object that implements enough of
27  * <code>java.sql.ResultSetMetaData</code>
28  * to exercise the {@link ResultSetDyaClass} functionality.</p>
29  *
30  * @author Craig R. McClanahan
31  * @version $Revision: 1.4 $ $Date: 2004/02/28 13:18:36 $
32  */

33
34 public class TestResultSetMetaData implements ResultSetMetaData JavaDoc {
35
36
37     // ----------------------------------------------------- Instance Variables
38

39
40     /**
41      * <p>Array of column names and class names for metadata.</p>
42      */

43     protected String JavaDoc metadata[][] = {
44         { "bigDecimalProperty", "java.math.BigDecimal" },
45         { "booleanProperty", Boolean JavaDoc.class.getName() },
46         { "byteProperty", Byte JavaDoc.class.getName() },
47         { "dateProperty", "java.sql.Date" },
48         { "doubleProperty", Double JavaDoc.class.getName() },
49         { "floatProperty", Float JavaDoc.class.getName() },
50         { "intProperty", Integer JavaDoc.class.getName() },
51         { "longProperty", Long JavaDoc.class.getName() },
52         { "nullProperty", "java.lang.String" },
53         { "shortProperty", Short JavaDoc.class.getName() },
54         { "stringProperty", "java.lang.String" },
55         { "timeProperty", "java.sql.Time" },
56         { "timestampProperty", "java.sql.Timestamp" },
57     };
58
59
60     // ---------------------------------------------------- Implemented Methods
61

62
63     public String JavaDoc getColumnClassName(int columnIndex) throws SQLException JavaDoc {
64         return (metadata[columnIndex - 1][1]);
65     }
66
67
68     public int getColumnCount() throws SQLException JavaDoc {
69         return (metadata.length);
70     }
71
72     public String JavaDoc getColumnName(int columnIndex) throws SQLException JavaDoc {
73         return (metadata[columnIndex - 1][0]);
74     }
75
76
77     // -------------------------------------------------- Unimplemented Methods
78

79
80     public String JavaDoc getCatalogName(int columnIndex) throws SQLException JavaDoc {
81         throw new UnsupportedOperationException JavaDoc();
82     }
83
84
85     public int getColumnDisplaySize(int columnIndex) throws SQLException JavaDoc {
86         throw new UnsupportedOperationException JavaDoc();
87     }
88
89
90     public String JavaDoc getColumnLabel(int columnIndex) throws SQLException JavaDoc {
91         throw new UnsupportedOperationException JavaDoc();
92     }
93
94
95     public int getColumnType(int columnIndex) throws SQLException JavaDoc {
96         throw new UnsupportedOperationException JavaDoc();
97     }
98
99
100     public String JavaDoc getColumnTypeName(int columnIndex) throws SQLException JavaDoc {
101         throw new UnsupportedOperationException JavaDoc();
102     }
103
104
105     public int getPrecision(int columnIndex) throws SQLException JavaDoc {
106         throw new UnsupportedOperationException JavaDoc();
107     }
108
109
110     public int getScale(int columnIndex) throws SQLException JavaDoc {
111         throw new UnsupportedOperationException JavaDoc();
112     }
113
114
115     public String JavaDoc getSchemaName(int columnIndex) throws SQLException JavaDoc {
116         throw new UnsupportedOperationException JavaDoc();
117     }
118
119
120     public String JavaDoc getTableName(int columnIndex) throws SQLException JavaDoc {
121         throw new UnsupportedOperationException JavaDoc();
122     }
123
124
125     public boolean isAutoIncrement(int columnIndex) throws SQLException JavaDoc {
126         throw new UnsupportedOperationException JavaDoc();
127     }
128
129
130     public boolean isCaseSensitive(int columnIndex) throws SQLException JavaDoc {
131         throw new UnsupportedOperationException JavaDoc();
132     }
133
134
135     public boolean isCurrency(int columnIndex) throws SQLException JavaDoc {
136         throw new UnsupportedOperationException JavaDoc();
137     }
138
139
140     public boolean isDefinitelyWritable(int columnIndex) throws SQLException JavaDoc {
141         throw new UnsupportedOperationException JavaDoc();
142     }
143
144
145     public int isNullable(int columnIndex) throws SQLException JavaDoc {
146         throw new UnsupportedOperationException JavaDoc();
147     }
148
149
150     public boolean isReadOnly(int columnIndex) throws SQLException JavaDoc {
151         throw new UnsupportedOperationException JavaDoc();
152     }
153
154
155     public boolean isSearchable(int columnIndex) throws SQLException JavaDoc {
156         throw new UnsupportedOperationException JavaDoc();
157     }
158
159
160     public boolean isSigned(int columnIndex) throws SQLException JavaDoc {
161         throw new UnsupportedOperationException JavaDoc();
162     }
163
164
165     public boolean isWritable(int columnIndex) throws SQLException JavaDoc {
166         throw new UnsupportedOperationException JavaDoc();
167     }
168
169
170 }
171
Popular Tags