title: Problems with string parameter insertion into prepared statement
body: <p>I have a database running on an MS SQL Server. My application communicates via JDBC and ODBC with it. Now I try to use prepared statements.</p>
  
  <p>When I insert a numeric (Long) parameter everything works fine. When I insert a string 
  parameter it does not work. There is no error message, but an empty result set. </p>
  
  <pre><code>WHERE column LIKE ('%' + ? + '%') --inserted "test" -&gt; empty result set
  WHERE column LIKE ? --inserted "%test%" -&gt; empty result set
  WHERE column = ? --inserted "test" -&gt; works
  </code></pre>
  
  <p>But I need the LIKE functionality. When I insert the same string directly into the query string (not as a prepared statement parameter) it runs fine.</p>
  
  <pre><code>WHERE column LIKE '%test%'
  </code></pre>
  
  <p>It looks a little bit like double quoting for me, but I never used quotes inside a string. I use preparedStatement.setString(int index, String x) for insertion.</p>
  
  <p>What is causing this problem?
  How can I fix it?</p>
  
  <p>Thanks in advance.</p>