title: Running PreparedStatement with Like clause with wildcard
body: <p>I'm trying to execute following SQL query where it tries to find results that matches the column2 values ending with <code>abc</code></p>
  
  <pre><code> PreparedStatement stmt = conn.prepareStatement("SELECT column1 FROM dbo.table1 WHERE column2 LIKE ?");
   stmt.setString(1, "%" +"abc");
  </code></pre>
  
  <p>But it returns nothing even though there is a matching value. This only happens with SQL Server. Same query with informix database returns correct results. Anyone has an idea about what causing this to behave differently?</p>
  
  <p>Is this due to an issue in how <code>PreparedStatement</code> creates the SQL query for SQL Server?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I found out this happens when the data in the column which i perform the like contain space. eg: when the column contains "some word" and if i perform the search by <code>stmt.setString(1, "%" + "word");</code> it won't return a matching result but if i perform the same on for "someword" it would return the matching result</p>