当前位置:网站首页>Summary of common JDBC exceptions and error solutions
Summary of common JDBC exceptions and error solutions
2022-06-25 23:34:00 【_ Qilixiang】
Catalog
java.sql.SQLException: Invalid column index
java.sql.SQLException: ORA-00911: Invalid character
java.sql.SQLException: ORA-01017: invalid username/password; login denied
java.sql.SQLException: Io abnormal : The Network Adapter could not establish the connection at
java.sql.SQLException: No sutiable driver found for jsbc:oracle1:thin:
java.sql.SQLException: Invalid column index
1、sql List of ? The number of symbols does not match the number of variables provided :
for example :jdbcTemplate.update(sql, new Object[] {newState,oldState});
If sql There are 1 individual ? Number ,Object[] Yes 2 individual , You're going to report a mistake .
2、sql In the string ? The number is not written correctly
english ? And Chinese ? Sometimes it's hard to tell .
3、sql List of ? No '' All in all .
for example :sql="UPDATE abc SET abc.name='?' WHERE abc.id='?'";
hold '' Just remove it .
4, In this case select*from user where info like %?%;
Although this is sql Writing , But in jdbc It needs to be changed to select*from user where info like ?;
Such as ps.setString(1,“%”+value+“%”);
java.sql.SQLException: ORA-00911: Invalid character
String sql = "insert into test1 values(1416270201,' Zhang San ',' Dingxi ','01-8 month -17');";
Write one more semicolon
![]()
java.sql.SQLException: ORA-01017: invalid username/password; login denied
User password error 、 User name error :
![]()
java.sql.SQLException: Io abnormal : The Network Adapter could not establish the connection at
The firewall of the host to which you want to connect is turned off or its corresponding service is not turned on :
![]()
java.sql.SQLException: No sutiable driver found for jsbc:oracle1:thin:
URL Wrong writing
![]()
边栏推荐
- The software test interview has been suspended. The interviewer always says that the logical thinking is chaotic. What should I do?
- qtcreator 格式化代码
- String对象(常量)池
- B. Box Fitting-CodeCraft-21 and Codeforces Round #711 (Div. 2)
- Repoptimizer: it's actually repvgg2
- hiberate核心API/配置文件/一级缓存详解
- LeetCode-1528-重新排列字符串-哈希表-字符串
- Basic operator
- [opencv450 samples] read the image path list and maintain the proportional display
- After xampp restarts, the MySQL service cannot be started.
猜你喜欢

【opencv450-samples】inpaint 使用区域邻域恢复图像中的选定区域

Fegin client entry test

Hbuilderx uses the gaude map to obtain the current location

我的vscode

CTS RTS RX TX in serial port flow control UART (direct communication between serial port module and MCU)

问题记录与思考

做接口测试,这3种工具到底什么时候用?

QComboBox下拉菜单中有分隔符Separator时的样式设置

jdbc常见异常及错误解决办法汇总

【AXI】解读AXI协议原子化访问
随机推荐
Why is BeanUtils not recommended?
qtcreator 格式化代码
How to use drawing comparison function in CAD
C. Planar Reflections-CodeCraft-21 and Codeforces Round #711 (Div. 2)
My C language learning process
毕业旅行 | 伦敦5日游行程推荐
Uni app -- listen for the exit of the return key
Day3 data types and operators summary and job
Leetcode(435)——无重叠区间
【AXI】解读AXI协议原子化访问
CSDN force value
When are the three tools used for interface testing?
Efr32bg22 ble module (low power Bluetooth communication module) at command test
Episode 3: thread synchronization using thread lock
CDN加速是什么
RK3568+鸿蒙工控板工业网关视频网关解决方案
Qt 中文和英文分别使用不同的字体
Hbuilderx uses the gaude map to obtain the current location
C. Fibonacci Words-April Fools Day Contest 2021
User interaction scanner usage Advanced Edition example