[MonetDB-users] JDBC: Problem with PreparedStatement parameter in Buffer

Fabian Groffen Fabian.Groffen at cwi.nl
Mon Oct 10 11:11:51 CEST 2011

On 10-10-2011 12:04:16 +0300, George Garbis wrote:
> st = con.prepareStatement("SELECT Buffer(t.g, ?) AS buffer, t.g AS point
> FROM geom AS t"); // This line throws an SQLException

All queries from your mail, and in particular this one is misuse of the
prepared statement.  The question mark is meant to be used on positions
where it is clearly known what type is to be expected, e.g.:
  SELECT x, y FROM table WHERE id = ?;

> st.setFloat(1, (float)1.0);

You better just do string manipulation here, and send that to the
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: Digital signature
URL: <http://www.monetdb.org/pipermail/users-list/attachments/20111010/32b95c2a/attachment.sig>

More information about the users-list mailing list