当前位置: 代码迷 >> Java Web开发 >> 请教为什么在jsp中无法访问值为null
  详细解决方案

请教为什么在jsp中无法访问值为null

热度:113   发布时间:2016-04-17 12:23:01.0
请问为什么在jsp中无法访问值为null
sql="select devicenum from e8_device where idle=null' "
ResultSet rs= a.executeQuery(sql);
if (rs.next()) {
...
}
 系统总是找不到
不知道这是为什么

------解决方案--------------------
sql 中不能用=null 来判断是否为空 要用 is null

"select devicenum from e8_device where idle is null'"

------解决方案--------------------
用 is null
------解决方案--------------------
无错,在SQL中,判断是否为null,要用 where 字段 is null ,不能用 where 字段 = null
  相关解决方案