When I need to translate a PostgreSQL query such as:
SELECT * FROM tbl WHERE name = 'Smith';
into a PreparedStatement, I use something such as:
sql = con.prepareStatement("SELECT * FROM tbl WHERE name = ?");
sql.setString(1, myVariable);
How do I translate
SELECT * FROM tbl WHERE name LIKE '%Smith%';
I'm not sure what happens to ' and %.
Thank you all.