Mercurial > dive4elements > gnv-client
comparison geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEResultSetMetaData.java @ 132:5a583cff97ea
Implementation of the Datainfrastructure for fetching Data from different DataStores.
geo-backend/trunk@12 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 04 Sep 2009 08:11:30 +0000 |
parents | |
children | 0100ebf6630f |
comparison
equal
deleted
inserted
replaced
131:d8ff739b9f3b | 132:5a583cff97ea |
---|---|
1 /** | |
2 * | |
3 */ | |
4 package de.intevation.gnv.geobackend.sde.datasources; | |
5 | |
6 import java.sql.ResultSetMetaData; | |
7 import java.sql.SQLException; | |
8 import java.util.List; | |
9 | |
10 /** | |
11 * @author Tim Englich <tim.englich@intevation.de> | |
12 * | |
13 */ | |
14 public class ArcSDEResultSetMetaData implements ResultSetMetaData { | |
15 | |
16 private List<ColDefinition> columnDefinitions = null; | |
17 /** | |
18 * Constructor | |
19 */ | |
20 public ArcSDEResultSetMetaData(List<ColDefinition> columnDefinitions) { | |
21 this.columnDefinitions = columnDefinitions; | |
22 } | |
23 | |
24 /** | |
25 * @see java.sql.ResultSetMetaData#getCatalogName(int) | |
26 */ | |
27 public String getCatalogName(int column) throws SQLException { | |
28 | |
29 return null; | |
30 } | |
31 | |
32 /** | |
33 * @see java.sql.ResultSetMetaData#getColumnClassName(int) | |
34 */ | |
35 public String getColumnClassName(int column) throws SQLException { | |
36 | |
37 int type = this.getColumnType(column); | |
38 Class clazz = java.lang.Object.class; | |
39 if (type == 2){ | |
40 clazz = int.class; | |
41 } | |
42 // TODO weitere Klassen Implementieren | |
43 return clazz.getName(); | |
44 } | |
45 | |
46 /** | |
47 * @see java.sql.ResultSetMetaData#getColumnCount() | |
48 */ | |
49 public int getColumnCount() throws SQLException { | |
50 return columnDefinitions.size(); | |
51 } | |
52 | |
53 /** | |
54 * @see java.sql.ResultSetMetaData#getColumnDisplaySize(int) | |
55 */ | |
56 public int getColumnDisplaySize(int column) throws SQLException { | |
57 | |
58 return 0; | |
59 } | |
60 | |
61 /** | |
62 * @see java.sql.ResultSetMetaData#getColumnLabel(int) | |
63 */ | |
64 public String getColumnLabel(int column) throws SQLException { | |
65 return columnDefinitions.get(column-1).getName(); | |
66 } | |
67 | |
68 /** | |
69 * @see java.sql.ResultSetMetaData#getColumnName(int) | |
70 */ | |
71 public String getColumnName(int column) throws SQLException { | |
72 return columnDefinitions.get(column-1).getName(); | |
73 } | |
74 | |
75 /** | |
76 * @see java.sql.ResultSetMetaData#getColumnType(int) | |
77 */ | |
78 public int getColumnType(int column) throws SQLException { | |
79 return columnDefinitions.get(column-1).getType(); | |
80 } | |
81 | |
82 /** | |
83 * @see java.sql.ResultSetMetaData#getColumnTypeName(int) | |
84 */ | |
85 public String getColumnTypeName(int column) throws SQLException { | |
86 | |
87 return null; | |
88 } | |
89 | |
90 /** | |
91 * @see java.sql.ResultSetMetaData#getPrecision(int) | |
92 */ | |
93 public int getPrecision(int column) throws SQLException { | |
94 | |
95 return 0; | |
96 } | |
97 | |
98 /** | |
99 * @see java.sql.ResultSetMetaData#getScale(int) | |
100 */ | |
101 public int getScale(int column) throws SQLException { | |
102 | |
103 return 0; | |
104 } | |
105 | |
106 /** | |
107 * @see java.sql.ResultSetMetaData#getSchemaName(int) | |
108 */ | |
109 public String getSchemaName(int column) throws SQLException { | |
110 | |
111 return null; | |
112 } | |
113 | |
114 /** | |
115 * @see java.sql.ResultSetMetaData#getTableName(int) | |
116 */ | |
117 public String getTableName(int column) throws SQLException { | |
118 | |
119 return null; | |
120 } | |
121 | |
122 /** | |
123 * @see java.sql.ResultSetMetaData#isAutoIncrement(int) | |
124 */ | |
125 public boolean isAutoIncrement(int column) throws SQLException { | |
126 | |
127 return false; | |
128 } | |
129 | |
130 /** | |
131 * @see java.sql.ResultSetMetaData#isCaseSensitive(int) | |
132 */ | |
133 public boolean isCaseSensitive(int column) throws SQLException { | |
134 | |
135 return false; | |
136 } | |
137 | |
138 /** | |
139 * @see java.sql.ResultSetMetaData#isCurrency(int) | |
140 */ | |
141 public boolean isCurrency(int column) throws SQLException { | |
142 | |
143 return false; | |
144 } | |
145 | |
146 /** | |
147 * @see java.sql.ResultSetMetaData#isDefinitelyWritable(int) | |
148 */ | |
149 public boolean isDefinitelyWritable(int column) throws SQLException { | |
150 | |
151 return false; | |
152 } | |
153 | |
154 /** | |
155 * @see java.sql.ResultSetMetaData#isNullable(int) | |
156 */ | |
157 public int isNullable(int column) throws SQLException { | |
158 | |
159 return 0; | |
160 } | |
161 | |
162 /** | |
163 * @see java.sql.ResultSetMetaData#isReadOnly(int) | |
164 */ | |
165 public boolean isReadOnly(int column) throws SQLException { | |
166 | |
167 return true; | |
168 } | |
169 | |
170 /** | |
171 * @see java.sql.ResultSetMetaData#isSearchable(int) | |
172 */ | |
173 public boolean isSearchable(int column) throws SQLException { | |
174 | |
175 return true; | |
176 } | |
177 | |
178 /** | |
179 * @see java.sql.ResultSetMetaData#isSigned(int) | |
180 */ | |
181 public boolean isSigned(int column) throws SQLException { | |
182 | |
183 return false; | |
184 } | |
185 | |
186 /** | |
187 * @see java.sql.ResultSetMetaData#isWritable(int) | |
188 */ | |
189 public boolean isWritable(int column) throws SQLException { | |
190 | |
191 return false; | |
192 } | |
193 | |
194 } |