title: How does Java's PreparedStatement work?
body: <p>I am planning to replace repeatedly executed Statement objects with <code>PreparedStatement</code> objects to improve performance. I am using arguments like the MySQL function <code>now()</code>, and string variables. </p>
  
  <p>Most of the <code>PreparedStatement</code> queries I have seen contained constant values (like <code>10</code>, and strings like <code>"New York"</code>) as arguments used for the <code>?</code> in the queries. How would I go about using functions like <code>now()</code>, and variables as arguments? Is it necessary to use the <code>?</code>s in the queries instead of actual values? I am quite confounded.</p>