I have a question:
Suppose I use JDBC, JDBCTemplate in order to execute a sql query.
The query is something like:
query = "SELECT ... FROM ... WHERE user = ? AND password = ? AND x='valuex' AND y='valuey' ..."
Where user,password - I got from the web user - so I want it to be in a PreparedStatement.
But x,y,... (Suppose there are many variables like this) are values which I set their values myself at the code (e.g. constants), so there is no use for PreparedStatement on them.
Is there a way I can combine the two ways, something like:
PreparedStatement preparedStatement = ...
execute(query,preparedStatement,new Object('valuex','valuey'...)) ?
If there is, please write me an example of this part of the code, how can I do this exactly.