我的 sql 查询中有类似的东西
private static final String QUERY_PHYSICIAN_INFO= "SELECT * FROM PHYSICIAN_INFO WHERE ? = ?";
但以下不起作用..
Connection conn = null;
PreparedStatement stmt = null;
String logintype;
if(isInteger(id))
{
logintype="BADGEID";
}else{
logintype="ID";
}
stmt=conn.prepareStatement(QUERY_PHYSICIAN_INFO);
stmt.setString(1, logintype);
stmt.setString(2, id);
ResultSet rs = stmt.executeQuery();
Physician phs = null;
这有什么特别的原因吗?提前致谢。