title: Placeholders in SQL
body: <p>I prepared a sql script that inserts some test data into database so that you can run unit tests against it and have some unit test expectations, like there will be some properties with some values and can check validity of query by examining that data</p>
  
  <p>What I need to know is how java data access layer lets you use parameters in the statements, does it allow to use named parameters which is sql server standard or it uses "<code>?</code>" placeholders?</p>
  
  <p>So, for instance you want to execute following query</p>
  
  <pre><code>select * from items where ID = @ID
  </code></pre>
  
  <p>where <code>@ID</code> is a parameter that you can pass to the sql command before executing query.</p>
  
  <p>I am sure there is something in java for that, but depending on the data provider it allows you to use named parameters or just "<code>?</code>" placeholders, so sql should look like </p>
  
  <pre><code>select .. from .. where ID = ?
  </code></pre>