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.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…