Simon Mitchell <simon(at)jseb(dot)com> writes:
> // some bad code
> sqlText = "SELECT (date ?, date ?) OVERLAPS (date ?, date ?);";
That's not going to work, because the syntax
date 'something'
only works for literal constants, and a ? marker is not a literal constant.
You could try
?::date
or
CAST(? AS date)
if you prefer to avoid Postgres-specific syntax. Even better, don't use
setString --- that's really only meant for parameters that are of string
datatypes.
regards, tom lane