Java Prepared Statement arguments!

Posted by Epitaph on Stack Overflow See other posts from Stack Overflow or by Epitaph
Published on 2009-01-07T02:44:37Z Indexed on 2010/04/11 9:13 UTC
Read the original article Hit count: 481

Filed under:
|
|

I am planning to replace repeatedly executed Statement objects with PreparedStatement objects to improve performance. I am using arguments like the MySQL function now(), and string variables.

Most of the PreparedStatement queries I have seen contained constant values (like 10, and strings like "New York") as arguments used for the "?" in the queries. How would I go about using functions like now(), and variables as arguments? Is it necessary to use the "?"s in the queries instead of actual values? I am quite confounded.

© Stack Overflow or respective owner

Related posts about java

Related posts about jdbc