首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

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

2011-12-19 
请问为什么在jsp中无法访问值为nullsqlselect devicenum from e8_device where idlenull ResultSet r

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

热点排行