首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

Parameter index out of range (二 > number of parameters, which is 1)

2012-08-29 
Parameter index out of range (2 number of parameters, which is 1).Parameter index out of range (2

Parameter index out of range (2 > number of parameters, which is 1).

Parameter index out of range (2 > number of parameters, which is 1).

错误是预插入语句少了两个问号导致的,原因可能是sql语句'号使用不当导致的

String sql = "select * from t_mobile_picture where PIC_STATUS = '1"+ "' and IMEI_ID != ?" + " and (POW(ADJUST_JINGDU-?,2)+POW(ADJUST_WEIDU-?,2)<1)"+" order by CREATE_TIME desc limit ?,?";

?

如果不小心写成

String sql = "select * from t_mobile_picture where PIC_STATUS = '1"+ "' and IMEI_ID != ?" + "' and (POW(ADJUST_JINGDU-?,2)+POW(ADJUST_WEIDU-?,2)<1)"+" order by CREATE_TIME desc limit ?,?";

?

?

就会报上面的错误,"' and (POW 就这里的'导致的。

热点排行