1.错误描述 java.sql.SQLException:Column Index out of range,0<1 2.错误原因 try { Class.forName("com.mysql.jdbc.Driver"); Connection conn = null; Statement stat = null; ResultSet rs = null; try { conn = DriverManager.getConnection("jdbc:mysql://lo…
向SQL中传入数据是从1开始的!!! 从ResultSet中取数据也是从1开始的!…
1.错误描述 [ERROR:]2015-05-05 16:35:50,664 [异常拦截] org.hibernate.exception.GenericJDBCException: error executing work at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) at org.hibernate.engine.…
java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2). java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)…
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957) at com.mysql.jdbc.SQLError.…
一.错误原因分析 从错误提示可以看出:实际传入的参数大于sql中待设置的参数,也就是sql中的?少于参数或?根本没有产生原因:  ?号被单引号包围 如: sql += " and article_title like '%#{articleTitle}%'"; 二.解决办法 去掉单引号 上面sql改为: sql += " and article_title like concat('%',#{articleTitle},'%')";…
resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found. 代码: String sql="SELECT d.content,c.name AS categoryName FROM news_detail d,news_category c WHERE d.categoryId=c.id"; Object[] params ={}; System.out.println(this.executeQuery(sq…
当在resultmap中增加字段后,查询语句也必须增加相应字段,否则会报错, java.sql.SQLException: Column 'del_status' not found. 因为查询结果与resultmap对应不上,ibatis在查询获得结果集中找不到resultmap的对应字段, 我是在resultmap中增加字段,但select语句中并没有增加,折腾了半天 如果属性类型为基本类型而非包装类型,并且数据库中数据为null,那么就会报错 Caused by: java.lang.Ru…
1.错误描述 java.sql.SQLException:Column count doesn't match value count at row 1 2.错误原因     在插入数据时,插入的字段个数跟数据库表字段个数不一致 insert into student(sno,sname,sage,ssex) values(1,'张三丰','man'); 3.解决办法     保证插入数据字段个数跟数据库表中的字段个数一致 insert into student(sno,sname,sage,s…
最近由于数据库的全备出问题了,所以一直在观察. 刚好发现很多不需要的数据,就删了几百个G的数据吧. 今天突然就报这个问题. java.io.IOException: java.sql.SQLException: ORA: index 'BTO.PK_xxxxx' or partition of such index is in unusable state 索引处于不可用状态. 重建索引 OK…