读书人

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

发布时间: 2011-12-19 23:23:36 作者: rapoo

请问为什么在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

读书人网 >Java Web开发

热点推荐