PreparedStatement and empty String instead of space
843859Nov 13 2006 — edited Nov 24 2006Hi all, I would test a space value in a varchar field, i.e.:
PreparedStatement ps=con.prepareStatement();
String qry = "select a from table where b=? and c=?";
ps.setString(1,"value");
ps.setString(2," "); // space!!
That source code doesn't work: it set "" (empty String) in the second field, not " " (space).
Can I use PrepareStatement in any way to do this or I have to use only Statement?
Thanks.
Bye.