title: Parsing SQL query in Java
body: <p>I know by using prepared statement we can set the column values. Here what I want is, I already have a list of queries written to execute on same table but with different column values. E.g.</p>
  
  <pre><code>select * from tableName as t1 where t1.tableColumnId=4 and t1.tableColumnName='test' inner join tableName2 as t2 on t1.tableColumnId=t2.tableColumnId
  
  select * from tableName as t1 where t1.tableColumnId=6 and t1.tableColumnName='test' inner join tableName2 as t2 on t1.tableColumnId=t2.tableColumnId
  </code></pre>
  
  <p>As you can see both the queries are almost same except the <code>tableColumnId</code> value. I want to save this in collection as </p>
  
  <pre><code>select * from tableName as t1 where t1.tableColumnId=? and t1.tableColumnName='test' inner join tableName2 as t2 on t1.tableColumnId=t2.tableColumnId
  </code></pre>
  
  <p>So that I won't have duplicate queries (where values are not considered).</p>
  
  <p>How can I do this?</p>