java.sql.SQLException之数组越界

java.sql.SQLException之数组越界


1、具体错误如下:

(1)java.sql.SQLException:Parameter index out of range(0<1)


(2)java.sql.SQLException:Parameter index out of range(23>number of parameters,which is 22)


2、错误原因

在SQL语句传参的个数和接受的参数个数不一致,导致出错

ERROR: 2025-05-21 18:21:16.322 logId[e4cd1cd2d198493ba49ebe5fda881998] traceId[58cc9907288e441e] thread[qtp1519451306-1332] c.s.s.c.s.interceptor.ResponseJSONInterceptor: - [ALARM-SDS异常-SfmqPusherException],异常信息:errmsg[\n### Error updating database. Cause: java.sql.SQLException: runtime error: index out of range [1] with length 0\n### The error may exist in com/sftech/sds/innovation/center/mapper/tidbonlinesdsdata/eventmark/CollectionOrderRelyRelationMapper.java (best guess)\n### The error may involve com.sftech.sds.innovation.center.mapper.tidbonlinesdsdata.eventmark.CollectionOrderRelyRelationMapper.update-Inline\n### The error occurred while setting parameters\n### SQL: /* {\"xdb_comment\":\"1\",\"log_id\":\"e4cd1cd2d198493ba49ebe5fda881998,c33c94f6f6c8fe99\"} */ UPDATE collection_order_rely_relation SET area_code=?, dept_code=?, aoi_id=?, order_no=?, inc_day=?, emp_code=?, rely_address_id=?, pick_tm=?, waybill_no=?, parcel=?, product_name=?, rely_type=?, economic_type=?, detailed_address=?, stall_aoi_id=?, stall_near_aoi_id=?, province_name=?, city_name=?, county_name=? WHERE (waybill_no = ? AND inc_day = ?)\n### Cause: java.sql.SQLException: runtime error: index out of range [1] with length 0\n; uncategorized SQLException; SQL state [HY000]; error code [1105]; runtime error: index out of range [1] with length 0; nested exception is java.sql.SQLException: runtime error: index out of range [1] with length 0],参数信息:{\"timeStamp\":\"2025-05-21T18:21:15.945000000+08:00\",\"brokers\":\"\",\"flag\":0,\"data\":\"{\\\"areaCode\\\":\\\"532Y\\\",\\\"consignName\\\":\\\"樱桃\\\",\\\"economicType\\\":\\\"樱桃项目\\\",\\\"pickupTm\\\":\\\"2025-05-18 12:49:44\\\",\\\"aoiId\\\":\\\"532KU000176\\\",\\\"customerAcctCode\\\":\\\"5325124589\\\",\\\"deptCode\\\":\\\"532PDH\\\",\\\"productName\\\":\\\"特快包裹(新)\\\",\\\"waybillNo\\\":\\\"SF3176709041470\\\",\\\"pickupEmpCode\\\":\\\"40021597\\\"}\",\"expire\":\"\",\"topic\":\"pass_waybill_base_data_mark\",\"logId\":\"e4cd1cd2d198493ba49ebe5fda881998\",\"cmd\":\"pass_waybill_base_data_mark\",\"tag\":\"\",\"key\":\"SF3176709041470\"},堆栈信息:\ncom.sftech.sds.common.exception.ServerException: \n### Error updating database. Cause: java.sql.SQLException: runtime error: index out of range [1] with length 0\n### The error may exist in com/sftech/sds/innovation/center/mapper/tidbonlinesdsdata/eventmark/CollectionOrderRelyRelationMapper.java (best guess)\n### The error may involve com.sftech.sds.innovation.center.mapper.tidbonlinesdsdata.eventmark.CollectionOrderRelyRelationMapper.update-Inline\n### The error occurred while setting parameters\n### SQL: /* {\"xdb_comment\":\"1\",\"log_id\":\"e4cd1cd2d198493ba49ebe5fda881998,c33c94f6f6c8fe99\"} */ UPDATE collection_order_rely_relation SET area_code=?, dept_code=?, aoi_id=?, order_no=?, inc_day=?, emp_code=?, rely_address_id=?, pick_tm=?, waybill_no=?, parcel=?, product_name=?, rely_type=?, economic_type=?, detailed_address=?, stall_aoi_id=?, stall_near_aoi_id=?, province_name=?, city_name=?, county_name=? WHERE (waybill_no = ? AND inc_day = ?)\n### Cause: java.sql.SQLException: runtime error: index out of range [1] with length 0\n; uncategorized SQLException; SQL state [HY000]; error code [1105]; runtime error: index out of range [1] with length 0; nested exception is java.sql.SQLException: runtime error: index out of range [1] with length 0\n\t
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值