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

George Garbis ggarbis at di.uoa.gr
Mon Oct 10 11:04:16 CEST 2011

Hi all,

I am trying to use PreparedStatement to get a buffer of a geometry invoking
the commands bellow

PreparedStatement st = con.prepareStatement("CREATE TABLE geom (g
> geometry)");
> st.execute();
> st = con.prepareStatement("INSERT INTO geom VALUES(GeomFromText('POINT(1
> 1)', 2100))");
> st.execute();
> st = con.prepareStatement("SELECT Buffer(t.g, ?) AS buffer, t.g AS point
> FROM geom AS t"); // This line throws an SQLException
> st.setFloat(1, (float)1.0);
> ResultSet results = st.executeQuery();

However the fifth line throws an SQLException with this message:

> types geometry(0,0) and double(53,0) are not equal

Replacing the question mark with a number (e.g. 1.0) the program executes

Why is this exception thrown?
Is something wrong in my code?

Thanks in advance,
George Garbis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.monetdb.org/pipermail/users-list/attachments/20111010/0982cccb/attachment.html>

More information about the users-list mailing list