Re: Prepared statement with function as argument: how to bind values? - Mailing list pgsql-jdbc

From Maciek Sakrejda
Subject Re: Prepared statement with function as argument: how to bind values?
Date
Msg-id CAH_hXRas_aMNSbotahEuMTHU6KjgwJsztEO9K1hY+7gEXY_NCA@mail.gmail.com
Whole thread Raw
In response to Re: Prepared statement with function as argument: how to bind values?  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
> Do you have to quote 'POINT(?,?)'

Since that's an argument to ST_GeomFrom*Text*, I imagine he does. Or
do you mean is he quoting the parameter value with SQL apostrophe
quotes, which he shouldn't?. In any case, that looks like a weird
API--if there's a different function you can call, Alex, that will
take an actual point object, that would probably make your life
easier.

If this is all you have to work with, the problem is that you can't
parameterize a text literal. I think you would need to pass the full
String 'POINT(34.567 45.5621)' as a jdbc parameter value. However, I
don't quite understand the error you're getting. I would expect
complains about extra parameters, not about the number of columns
(which looks legit).

---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

pgsql-jdbc by date:

Previous
From: Radosław Smogura
Date:
Subject: Re: use of savepoint in containter managed transaction
Next
From: Mikko Tiihonen
Date:
Subject: Re: Binary transfer patches v15 - sending part was missing