Im not sure whether this is the right place to post .Im facing a problem while using prepared statement along with the update query (I use Postgresql.).I've placed my code below,
However ,upon running . In the console im able to print the values of properties in the bean .
But when I print the query that is generated using PrepareStatement.
UPDATE DOMAIN SET OBJECTID=?,ISACTIVE=?,CODE=?,DESCRIPTION=?,ISEDITABLE=?,DOMAINTYPE_OID=? WHERE OBJECTID=?
PreparedStatements don't work (or at least tend not to - there are exceptions) by converting bound values directly to strings and passing a query to the data base. How drivers do this will be different but typically the SQL statement (with the place holders for the parameters) plus the parameters values themselves are sent and its up to the database to do the binding.
Hi Paul ,
Thanks for replying . I guess the preparedstatement doesn't behave the way i was expecting it to with the update statement .But I resolved the issue by passing each of the fields passing them separately rather than using a '?'. and it worked.