| 61 |
61 |
import java.util.HashMap;
|
| 62 |
62 |
import java.util.Hashtable;
|
| 63 |
63 |
import java.util.Map;
|
|
64 |
import java.util.Random;
|
| 64 |
65 |
|
| 65 |
66 |
import org.apache.log4j.Logger;
|
| 66 |
67 |
import org.joda.time.DateTime;
|
| ... | ... | |
| 398 |
399 |
throws ReadDriverException {
|
| 399 |
400 |
PostGisFeatureIterator geomIterator = null;
|
| 400 |
401 |
try {
|
| 401 |
|
// st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
|
| 402 |
|
// ResultSet.CONCUR_READ_ONLY);
|
| 403 |
|
|
| 404 |
|
// st = conn.createStatement
|
| 405 |
|
if (provCursorName != null) {
|
| 406 |
|
/*
|
| 407 |
|
* st.execute("BEGIN"); st.execute("CLOSE " + provCursorName);
|
| 408 |
|
* bCursorActivo = false; st.execute("COMMIT");
|
| 409 |
|
*/
|
| 410 |
|
numProvCursors++;
|
| 411 |
|
}
|
| 412 |
|
// st.execute("BEGIN");
|
| 413 |
|
provCursorName = getTableName() + myCursorId + "wkb_cursor_prov_"
|
| 414 |
|
+ System.currentTimeMillis() + "" + numProvCursors;
|
|
402 |
// st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
|
|
403 |
// ResultSet.CONCUR_READ_ONLY);
|
|
404 |
|
|
405 |
// st = conn.createStatement
|
|
406 |
if (provCursorName != null) {
|
|
407 |
/*
|
|
408 |
* st.execute("BEGIN"); st.execute("CLOSE " + provCursorName);
|
|
409 |
* bCursorActivo = false; st.execute("COMMIT");
|
|
410 |
*/
|
|
411 |
numProvCursors++;
|
|
412 |
}
|
|
413 |
// st.execute("BEGIN");
|
|
414 |
String provCursorName = getTableName() +"_wkb_cursor_prov_" + Long.toString(Math.abs(new Random().nextLong()));
|
| 415 |
415 |
|
| 416 |
|
// st.execute("BEGIN");
|
|
416 |
// st.execute("BEGIN");
|
| 417 |
417 |
bCursorActivo = true;
|
| 418 |
|
// ResultSet rs = st.executeQuery(sql);
|
| 419 |
|
geomIterator = new PostGisFeatureIterator(
|
| 420 |
|
((ConnectionJDBC) conn).getConnection(), provCursorName,
|
| 421 |
|
sql);
|
|
418 |
// ResultSet rs = st.executeQuery(sql);
|
|
419 |
geomIterator = new PostGisFeatureIterator(
|
|
420 |
((ConnectionJDBC) conn).getConnection(), provCursorName,
|
|
421 |
sql);
|
| 422 |
422 |
} catch (SQLException e) {
|
| 423 |
|
// e.printStackTrace();
|
| 424 |
|
// e.printStackTrace();
|
| 425 |
|
// SqlDriveExceptionType type = new SqlDriveExceptionType();
|
| 426 |
|
// type.setDriverName("PostGIS Driver");
|
| 427 |
|
// type.setSql(sql);
|
| 428 |
|
// type.setLayerName(getTableName());
|
| 429 |
|
// type.setSchema(null);
|
|
423 |
// e.printStackTrace();
|
|
424 |
// e.printStackTrace();
|
|
425 |
// SqlDriveExceptionType type = new SqlDriveExceptionType();
|
|
426 |
// type.setDriverName("PostGIS Driver");
|
|
427 |
// type.setSql(sql);
|
|
428 |
// type.setLayerName(getTableName());
|
|
429 |
// type.setSchema(null);
|
| 430 |
430 |
throw new ReadDriverException("PostGIS Driver", e);
|
| 431 |
|
// throw new DriverException(e);
|
| 432 |
|
// return null;
|
|
431 |
// throw new DriverException(e);
|
|
432 |
// return null;
|
| 433 |
433 |
}
|
| 434 |
434 |
|
| 435 |
435 |
return geomIterator;
|