像这样的错误我想大家可能是长有的错误希望大家都能掌握
这样的错误是由于我们在开发时不小心出的错
java.sql.SQLException: 索引中丢失 IN 或 OUT 参数:: 2
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1681)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3280)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
at com.spring.services.UserBusiness.loginAction(UserBusiness.java:58)
at com.spring.services.UserBusiness.main(UserBusiness.java:27)
出现原因为:参数不匹配,参数个数有问题,参数 sql有问题
这个错误有很多人在发送语句时出的错.如:
有的sql语句可能全角与半角出现的:java.sql.SQLException无效的列索引,
StringBuilder sql = new StringBuilder()
.append("select * from emp where uname=? and upass=? and state=? and a=?");
参数据过多等
而我今天在开发一个Struts项目时出的是Oracle的一个错误如下:
StringBuilder sql = new StringBuilder()
.append("select * from emp where uname=? and upass=?");
//2.PreparedStatement对象指令
ps = conn.prepareStatement(sql.toString());
//3.设置参数
ps.setObject(1, dto.get("uname").toString());
ps.setObject(1, dto.get("upass").toString());
//4.执行判断
rs = ps.executeQuery();
这是由于一不小心就出错的这里只是设置参数的时候参数位置出了错
像这样的错误如果我们知道的话就可以在一堆代码中很快就能找到对吧
最终发现参数不匹配的原因:总结一下以备以后遇到同样的异常问题!!
相关推荐
java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK ……
在oracle里面运行一下,解决Exception java.sql.SQLException ORA-00600 内部错误代码
NULL 博文链接:https://zhang-zling.iteye.com/blog/980488
NULL 博文链接:https://listen-raining.iteye.com/blog/1962065
本文主要介绍了关于MySQL存储表情报错:java.sql.SQLException: Incorrect string value: ‘\xF0\x9F\x92\xA9\x0D\x0A…’的相关解决方法,分享出供大家参考学习,下面话不多说了,来一起看看详细的介绍: ...
服务器出现java.sql.SQLException No suitable driver found for 的
主要给大家介绍了关于MySQL存储表情时报错:java.sql.SQLException: Incorrect string value: 'xF0x9Fx92xA9x0Dx0A...'的解决方法,文中通过示例代码介绍的非常详细,需要的朋友可以参考借鉴,下面来一起看看吧。
请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient.SqlException: 无法打开登录所请求的数据库 “TakeClass”。登录失败。 用户 ‘2D2727E2578F446\...
oracle ora-各种常见java.sql.SQLException归纳
oracle 10g 数据库驱动下载:oracle jdbc dirver
java.sql.SQLException: null, message from server: “Host ‘223.72.41.7’ is not allowed to connect to this MySQL server” 客户端访问时报错: 解决方法: 1,登陆服务器 mysql> use mysql; //用mysql ...
已成功与服务器建立连接,但是在登录过程中发生错误 (provider: 共享内存提供程序, error: 0 - 管道的另一端上无任何进程。) 用户 'sa' 登录失败。该用户与可信 SQL Server 连接无关联。 说明: 执行当前 Web 请求...
Q: I am working with ... I am using updateBinaryStream method of resultset to update the BLOB field but it is failing after giving following exception java.sql.SQLException: Internal Error: Unable to
mysql5.6连接驱动jaf,可处理报错java.sql.SQLException: No suitable driver
异常错误:java.sql.SQLException: The server time zone value ‘?й???’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTime...
Unknown column 'fillMen' in 'field list' java.sql.SQLException: Operation not ...java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in
Caused by: java.sql.SQLException: java.lang.ClassNotFoundException: org.apache.hive.jdbc.HiveDriver at com.trs.gateway.commons.hive.HiveFeature.getConnection(HiveFeature.java:57) at ...
主要介绍了java.util.concurrent.ExecutionException 问题解决方法的相关资料,需要的朋友可以参考下
有关表死锁的详细图片 博文链接:https://meteor-1988.iteye.com/blog/1568695