Spring JdbcTemplate 无效的列索引错误
来源:互联网 发布:淘宝网店关闭怎么激活 编辑:程序博客网 时间:2024/05/22 11:37
报错信息类似:
executing PreparedStatementCallback [org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator@14041ec]): encountered SQLException [无效的列索引]; nested exception is java.sql.SQLException: 无效的列索引
java.sql.SQLException: 无效的列索引
“无效的列索引”其实是个低级的错误,原因无非几个:
1、sql串的?号数目和提供的变量数目不一致:
例如:jdbcTemplate.update(sql, new Object[] {newState,oldState});
如果sql里面有1个?号,Object[]送了2个,就会报错。
2、sql串里的?号书写不正确
英文?和中文?有时难以区分。
3、sql串的?号用''括了起来。
例如:sql="UPDATE abc SET abc.name='?' WHERE abc.id='?'";
把''去掉就可以了。
- Spring JdbcTemplate 无效的列索引错误
- Spring JdbcTemplate 无效的列索引错误
- 无效的列索引
- 无效的列索引
- oracle存储过程报"无效的列索引"的错误
- 操作数据库时报“无效的列索引”错误
- PreparedStatement 查询时无效的列索引
- oracleJava.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- java.sql.SQLException: 无效的列索引
- activemq 异常 Failed to start ActiveMQ JMS Message Broker. Reason: java.net.SocketException: No such device
- windows下mysql数据库每天自动备份php脚本
- js倒计时(年月天小时分秒)
- Git 中文教程
- js实现倒计时(天小时秒)
- Spring JdbcTemplate 无效的列索引错误
- 在VMware中用Kgdb调试linux内核和Cannot insert breakpoint Error accessing memory address的解决方法
- 常见的PCB工具软件介绍【转载】
- 每位开发人员都应铭记的10句编程谚语
- oracle 两个小问题
- Mentor.Graphics.Expedition.Enterprise.Flow(WG2005) 安装
- C# 简单的XML读取修改写入
- 继续 《学习opencv》第三章习题第5,6题
- linux php mysql