sql="select devicenum from e8_device where idle=null' "
ResultSet rs= a.executeQuery(sql);
if (rs.next()) {
...
}
 系统总是找不到
不知道这是为什么  

解决方案 »

  1.   

    idle=null' 
    =========?
    ='null'   ???
      

  2.   

    你确定数据库里面default是null么?而不是空?就是什么都没有?
      

  3.   

    不知道你说的是什么情况,如果你查找数据库中该字段的值是 “null”的话 直接用 ='null'
    如果是要查找数据库中该字段的值是否为空null的话 这个跟底层数据库有关,比如oracle 数据库 你可以这样写
    where 字段 is null
      

  4.   

    sql 中不能用=null 来判断是否为空 要用 is null"select devicenum from e8_device where idle is null'"
      

  5.   

    无错,在SQL中,判断是否为null,要用 where 字段 is null ,不能用 where 字段 = null
      

  6.   

    在sybase和sql server中=null 是可以的,不过确实jsp不支持,jsp,oracle都是 is null