Revision 10626 trunk/extensions/extJDBC/src/com/iver/cit/gvsig/fmap/drivers/jdbc/hsqldb/HSQLDBDriver.java
HSQLDBDriver.java | ||
---|---|---|
49 | 49 |
import java.sql.SQLException; |
50 | 50 |
import java.sql.Statement; |
51 | 51 |
|
52 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
52 | 53 |
import com.hardcode.gdbms.engine.data.edition.DataWare; |
53 |
import com.iver.cit.gvsig.fmap.DriverException;
|
|
54 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException;
|
|
54 | 55 |
import com.iver.cit.gvsig.fmap.SqlDriveExceptionType; |
55 | 56 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
56 | 57 |
import com.iver.cit.gvsig.fmap.drivers.DBLayerDefinition; |
... | ... | |
97 | 98 |
/** |
98 | 99 |
* @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getShape(int) |
99 | 100 |
*/ |
100 |
public IGeometry getShape(int index) { |
|
101 |
public IGeometry getShape(int index) throws ReadDriverException {
|
|
101 | 102 |
IGeometry geom = null; |
102 | 103 |
boolean resul; |
103 | 104 |
try { |
... | ... | |
166 | 167 |
} |
167 | 168 |
|
168 | 169 |
/** |
170 |
* @throws ExpansionFileReadException |
|
169 | 171 |
* @see com.iver.cit.gvsig.fmap.layers.ReadableVectorial#getFullExtent() |
170 | 172 |
*/ |
171 |
public Rectangle2D getFullExtent(){ |
|
173 |
public Rectangle2D getFullExtent() throws ReadDriverException, ExpansionFileReadException{
|
|
172 | 174 |
if (fullExtent == null) |
173 | 175 |
{ |
174 |
try |
|
175 |
{ |
|
176 | 176 |
IFeatureIterator itGeom = getFeatureIterator("SELECT the_geom AS the_geom FROM " + getLyrDef().getTableName()); |
177 | 177 |
IGeometry geom; |
178 | 178 |
int cont = 0; |
... | ... | |
185 | 185 |
fullExtent.add(geom.getBounds2D()); |
186 | 186 |
cont++; |
187 | 187 |
} |
188 |
} |
|
189 |
catch (DriverException e) { |
|
190 |
// TODO Auto-generated catch block |
|
191 |
e.printStackTrace(); |
|
192 |
} |
|
193 |
|
|
194 |
} |
|
188 |
} |
|
195 | 189 |
return fullExtent; |
196 | 190 |
} |
197 | 191 |
/* (non-Javadoc) |
198 | 192 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDatabaseDriver#getGeometryIterator(java.lang.String) |
199 | 193 |
*/ |
200 |
public IFeatureIterator getFeatureIterator(String sql) throws com.iver.cit.gvsig.fmap.DriverException {
|
|
194 |
public IFeatureIterator getFeatureIterator(String sql) throws ReadDriverException {
|
|
201 | 195 |
Statement st; |
202 | 196 |
HSQLDBFeatureIterator geomIterator = null; |
203 | 197 |
try { |
... | ... | |
206 | 200 |
ResultSet rs = st.executeQuery(sql); |
207 | 201 |
geomIterator = new HSQLDBFeatureIterator(rs); |
208 | 202 |
} catch (SQLException e) { |
209 |
e.printStackTrace(); |
|
210 |
SqlDriveExceptionType type = new SqlDriveExceptionType(); |
|
211 |
type.setLayerName(this.getTableName()); |
|
212 |
type.setDriverName(this.getName()); |
|
213 |
type.setSchema(this.getLyrDef()); |
|
214 |
type.setSql(sql); |
|
215 |
throw new com.iver.cit.gvsig.fmap.DriverException(e, type);
|
|
203 |
// e.printStackTrace();
|
|
204 |
// SqlDriveExceptionType type = new SqlDriveExceptionType();
|
|
205 |
// type.setLayerName(this.getTableName());
|
|
206 |
// type.setDriverName(this.getName());
|
|
207 |
// type.setSchema(this.getLyrDef());
|
|
208 |
// type.setSql(sql);
|
|
209 |
throw new ReadDriverException(getName(),e);
|
|
216 | 210 |
} |
217 | 211 |
|
218 | 212 |
return geomIterator; |
... | ... | |
220 | 214 |
/* (non-Javadoc) |
221 | 215 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDatabaseDriver#getGeometryIterator(java.awt.geom.Rectangle2D) |
222 | 216 |
*/ |
223 |
public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG) throws DriverException { |
|
217 |
public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG) throws ReadDriverException {
|
|
224 | 218 |
if (workingArea != null){ |
225 | 219 |
r = r.createIntersection(workingArea); |
226 | 220 |
} |
... | ... | |
268 | 262 |
/** |
269 | 263 |
* @see com.hardcode.gdbms.engine.data.driver.ObjectDriver#getPrimaryKeys() |
270 | 264 |
*/ |
271 |
public int[] getPrimaryKeys() throws com.hardcode.gdbms.engine.data.driver.DriverException {
|
|
265 |
public int[] getPrimaryKeys() throws ReadDriverException {
|
|
272 | 266 |
return null; |
273 | 267 |
} |
274 | 268 |
/** |
... | ... | |
280 | 274 |
/** |
281 | 275 |
* @see com.hardcode.gdbms.engine.data.driver.ObjectDriver#write(com.hardcode.gdbms.engine.data.edition.DataWare) |
282 | 276 |
*/ |
283 |
public void write(DataWare arg0) throws com.hardcode.gdbms.engine.data.driver.DriverException {
|
|
277 |
public void write(DataWare arg0) throws ReadDriverException {
|
|
284 | 278 |
// TODO Auto-generated method stub |
285 | 279 |
|
286 | 280 |
} |
... | ... | |
299 | 293 |
/* (non-Javadoc) |
300 | 294 |
* @see com.iver.cit.gvsig.fmap.drivers.VectorialDatabaseDriver#getFeatureIterator(java.awt.geom.Rectangle2D, java.lang.String, java.lang.String[]) |
301 | 295 |
*/ |
302 |
public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG, String[] alphaNumericFieldsNeeded) throws DriverException { |
|
296 |
public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG, String[] alphaNumericFieldsNeeded) throws ReadDriverException {
|
|
303 | 297 |
// TODO Auto-generated method stub |
304 | 298 |
return null; |
305 | 299 |
} |
Also available in: Unified diff