我的静态查询为Select * from Emp where Empid in (?)
,我的值为(?)。我无法放置这个价值。请指导我。让我知道,我需要其他任何东西。
答案 0 :(得分:1)
试试这个java代码:
public boolean yourMethod(String yuorValue) {
String sql = "select * from user where fieldName = ?";
PreparedStatement stmt = connection.prepareStatement(sql);
stmt.setString(1, yuorValue);//fieldvalue(1), Your passing value
ResultSet rs = stmt.executeQuery();
return rs.next();
}