当前位置:网站首页>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
parameterIndex
Parameter 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('%',?,'%')
边栏推荐
- As a leader, how to control the code version and demand development when the epidemic comes| Community essay solicitation
- Three. JS local environment setup
- Check log4j problems using stain analysis
- Use cve-2021-43893 to delete files on the domain controller
- 为什么会选择框架?选择什么样的框架
- Tensorflow to pytorch notes; tf. gather_ Nd (x, y) to pytorch
- C language beginner level - pointer explanation - paoding jieniu chapter
- 后管中编辑与预览获取表单的值写法
- [fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
- sql server数据库添加 mdf数据库文件,遇到的报错
猜你喜欢
Installation and use of memory leak tool VLD
Summary of interview project technology stack
I2C 子系统(四):I2C debug
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]
Kubernetes cluster log and efk architecture log scheme
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
Thunderbolt Chrome extension caused the data returned by the server JS parsing page data exception
random shuffle注意
I2C subsystem (I): I2C spec
Baidu map - surrounding search
随机推荐
Build a private cloud disk cloudrev
As a leader, how to control the code version and demand development when the epidemic comes| Community essay solicitation
Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记
How to implement append in tensor
Change cell color in Excel using C - cell color changing in Excel using C
Kubernetes family container housekeeper pod online Q & A?
leetcode540
[translation] flux is safe. Gain more confidence through fuzzy processing
SQL server queries the table structure of the specified table
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
Notifydatasetchanged not applicable to recyclerview - notifydatasetchanged not working on recyclerview
Opengauss database development and debugging tool guide
内存泄漏工具VLD安装及使用
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)
2022-2028 global splicing display industry research and trend analysis report
Force freeing memory in PHP
Interview stereotyped version
左连接,内连接
Three. JS local environment setup