Commit 9496d3ae authored by Luna Riegel's avatar Luna Riegel
Browse files

Fix: Fix columname in prepared statements

parent ec6dae8f
......@@ -131,7 +131,7 @@ public class DatabaseHandler {
List<CityObject> intersectingObjects = new ArrayList<>();
try (Connection con = new ConnectionWrapper(H2GISDBFactory.openSpatialDataBase(DB_NAME))) {
try (PreparedStatement ps = con.prepareStatement("SELECT gmlid, bbox, data, type FROM features AS tab1" +
" WHERE ST_INTERSECTS(ST_BUFFER(tab1.geom,?), (SELECT GEOM FROM features WHERE gmlid = ?)) AND tab1.gmlid <> ?")) {
" WHERE ST_INTERSECTS(ST_BUFFER(tab1.bbox,?), (SELECT bbox FROM features WHERE gmlid = ?)) AND tab1.gmlid <> ?")) {
ps.setDouble(1, bufferSize);
ps.setString(2, co.getGmlId().toString());
ps.setString(3, co.getGmlId().toString());
......@@ -150,7 +150,7 @@ public class DatabaseHandler {
try (Connection con = new ConnectionWrapper(H2GISDBFactory.openSpatialDataBase(DB_NAME))) {
try (PreparedStatement ps = con.prepareStatement("SELECT gmlid, bbox, data, type FROM features AS tab1" +
" WHERE ST_INTERSECTS(tab1.geom, (SELECT GEOM FROM features WHERE gmlid = ?)) AND tab1.gmlid <> ?")) {
" WHERE ST_INTERSECTS(tab1.bbox, (SELECT bbox FROM features WHERE gmlid = ?)) AND tab1.gmlid <> ?")) {
ps.setString(1, co.getGmlId().toString());
ps.setString(2, co.getGmlId().toString());
ResultSet rs = ps.executeQuery();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment