27 May
2013
27 May
'13
7:23 p.m.
Is there a way to use JDBC PreparedStatements to insert geospatial data? Here's what my prepared statement looks like: PreparedStatement statement = sqlRunner.prepareStatement(insertStatement); statement.setString(1, id); statement.setString(2, feature.getName()); statement.setString(3, feature.getDescription()); statement.setString(4, feature.getType().toString()); statement.setString(5, feature.getGeometry()); statement.executeUpdate(); In this case, feature.getGeometry() returns a string in WKT format. Here's the error I get: EXEC: wrong type for argument 5 of prepared statement: char, expected geometry Thoughts? Thanks, Casey