nested exception is java.sql.SQLException: 无效的列索引
严重:Exceptionoccurredduringprocessingrequest:PreparedStatementCallback;invalidResultSe...
严重: Exception occurred during processing request: PreparedStatementCallback; invalid ResultSet access for SQL [insert into process (id,process_name,process_levle,process_begin_person,process_begin_rerson_id,process_next_person,process_begin_time,process_end_time,process_content)values(process_seq.Nextval,?,?,?,?,to_date(?, 'YYYY-MM-DD HH24:MI:SS'),?,to_date(?, 'YYYY-MM-DD HH24:MI:SS'),?)]; nested exception is java.sql.SQLException: 无效的列索引
org.springframework.jdbc.InvalidResultSetAccessException: PreparedStatementCallback; invalid ResultSet access for SQL [insert into process (id,process_name,process_levle,process_begin_person,process_begin_rerson_id,process_next_person,process_begin_time,process_end_time,process_content)values(process_seq.Nextval,?,?,?,?,to_date(?, 'YYYY-MM-DD HH24:MI:SS'),?,to_date(?, 'YYYY-MM-DD HH24:MI:SS'),?)]; nested exception is java.sql.SQLException: 无效的列索引 展开
org.springframework.jdbc.InvalidResultSetAccessException: PreparedStatementCallback; invalid ResultSet access for SQL [insert into process (id,process_name,process_levle,process_begin_person,process_begin_rerson_id,process_next_person,process_begin_time,process_end_time,process_content)values(process_seq.Nextval,?,?,?,?,to_date(?, 'YYYY-MM-DD HH24:MI:SS'),?,to_date(?, 'YYYY-MM-DD HH24:MI:SS'),?)]; nested exception is java.sql.SQLException: 无效的列索引 展开
展开全部
你的Sql语句中。insert()这里面定义的操作列个数是9个。而values()里面实际传参数量是8个。传参数量不匹配。就造成了"无效列索引"的提示。
你可以检查一下。values参数中,process_begin_time列值前应该还缺少一个参数
你可以检查一下。values参数中,process_begin_time列值前应该还缺少一个参数
更多追问追答
追答
哦。我看错了。你insert里面定义的是两个time类型的字段挨着的。而实际传参时。两个时间类型的值中间有个普通类型参数。你检查一下传参是否与定义列匹配。类型不一样。也可能会导致错误。
追问
to_date('2017-06-24 12:52:08','yyyy-mm-dd hh24:mi:ss'),前面是string,数据库里是date,报输入值对于日期格式不够长怎么回事
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询