当前位置:网站首页>Parameter index out of range (1 > number of parameters, which is 0)
Parameter index out of range (1 > number of parameters, which is 0)
2022-07-03 02:57:00 【A stream kite CD】
Here is the error message
select * from user where uid like '%?%'
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.PreparedStatement.checkBounds(PreparedStatement.java:3288)
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3272)
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3314)
at com.mysql.jdbc.PreparedStatement.setInt(PreparedStatement.java:3258)
at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:3533)
Possible errors in precompiled assignment :
- The specified assignment position is wrong , namely
parameterIndexParameter error , The value of this parameter is from 1 Start- The number of assignments is not enough
Guarantee sql There is no mistake in the statement , And use precompiled assignment without error :
…
It could be sql The character splicing method used in the statement is incorrect , This is what Xiaobian is like , The above-mentioned exception occurs when using single quotation marks at the beginning .
resolvent :
change sql The splicing of statements , Xiaobian changed toselect * from user where uid like concat('%',?,'%')
边栏推荐
- Use cve-2021-43893 to delete files on the domain controller
- I2C subsystem (III): I2C driver
- JS finds all the parent nodes or child nodes under a node according to the tree structure
- I2C 子系统(四):I2C debug
- sql server 查询指定表的表结构
- 力扣------网格中的最小路径代价
- What is the way out for children from poor families?
- Unity3d human skin real time rendering real simulated human skin real time rendering "suggestions collection"
- leetcode540
- Add MDF database file to SQL Server database, and the error is reported
猜你喜欢
![[principles of multithreading and high concurrency: 1_cpu multi-level cache model]](/img/7e/ad9ea78868126b149bd9f15f587e6c.jpg)
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]

Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记

Xiaodi notes
![Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid](/img/32/25771baad1ed06c5a592087df748f1.jpg)
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid

Matlab tips (24) RBF, GRNN, PNN neural network

random shuffle注意

Do you really understand relays?

Build a private cloud disk cloudrev

I2C 子系统(三):I2C Driver

HTB-Devel
随机推荐
Installation and use of memory leak tool VLD
Introduction to cron expression
JS finds all the parent nodes or child nodes under a node according to the tree structure
Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
后管中编辑与预览获取表单的值写法
[fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)
xiaodi-笔记
[C语言]给账号密码进行MD5加密
Sous - système I2C (IV): débogage I2C
SqlServer行转列PIVOT
leetcode540
Notifydatasetchanged not applicable to recyclerview - notifydatasetchanged not working on recyclerview
SQL server queries the table structure of the specified table
Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记
Le processus de connexion mysql avec docker
How to limit the size of the dictionary- How to limit the size of a dictionary?
从C到Capable-----利用指针作为函数参数求字符串是否为回文字符
I2C subsystem (II): I3C spec
[shutter] monitor the transparency gradient of the scrolling action control component (remove the blank of the top status bar | frame layout component | transparency component | monitor the scrolling
Joking about Domain Driven Design (III) -- Dilemma