日期:2014-05-16 浏览次数:20456 次
java.sql.PreparedStatement ps = connection().prepareStatement("select * from test where name='hello'"); java.sql.ResultSet rs = ps.executeQuery();
java.sql.PreparedStatement ps = connection().prepareStatement("select * from test where name=?"); ps.setString(1,"hello"); java.sql.ResultSet rs = ps.executeQuery();
ps.setString(1,cast("hello",char(7)));这样可以解决问题。