The statement is
SELECT * FROM tableA WHERE x = ?
and the parameter is inserted via java.sql.PreparedStatement \'stmt\'
stm
If you use for instance mysql you could probably do something like:
select * from mytable where ifnull(mycolumn,'') = ?;
Then yo could do:
stmt.setString(1, foo == null ? "" : foo);
You would have to check your explain plan to see if it improves your performance. It though would mean that the empty string is equal to null, so it is not granted it would fit your needs.