项目遇到的问题一

发现项目日志里面有这样的错误

(表明和字段我替换了一下)
2014-09-05 13:21:41,004 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-127.0.0.1-8080-5) about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2014-09-05 13:21:41,004 DEBUG [org.hibernate.SQL] (http-127.0.0.1-8080-5) insert into XX_TABLE (COLUMN1,COLUMN2, COLUMN3......) values (XXX.nextval, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2014-09-05 13:21:41,005 INFO  [STDOUT] (http-127.0.0.1-8080-5) Hibernate: insert into XX_TABLE (COLUMN1,COLUMN2, COLUMN3......) values (XXX.nextval, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2014-09-05 13:21:41,326 WARN  [org.jboss.resource.connectionmanager.TxConnectionManager] (http-127.0.0.1-8080-5) Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@14a2b5f9[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@1023a4c5 handles=1 lastUse=1409894453220 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$PoolBySubjectAndCri@141689ca context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@53b03713 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@55efeb51 txSync=null]
java.lang.ArrayIndexOutOfBoundsException: 11
	at oracle.jdbc.driver.OracleSql.computeBasicInfo(OracleSql.java:950)
	at oracle.jdbc.driver.OracleSql.getSqlKind(OracleSql.java:623)
	at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:1212)


只是简单的数据插入,居然有这样的错误, GOOGLE发现这边文章讲的很清楚
http://stackoverflow.com/questions/277744/jdbc-oracle-arrayindexoutofboundsexception
从10.2.0.0.0 to 11.1.0.7.0 如果插入的参数超过7列就报错, 我这个是11个参数。

然后我检查了下我的ojdbc.jar发现版本是:
Created-By: 1.6.0 (Sun Microsystems Inc.)
Specification-Title: Oracle JDBC driver classes for use with JDK6
Specification-Version: Oracle JDBC Driver version - "11.1.0.7.0-Produc
 tion"
Main-Class: oracle.jdbc.OracleDriver


然后我就替换成12.1.0.1.0的版本, 然后错误就解决了。

同样的ORACLE论坛上面也是这么一说,第二页有人说用高版本就没错
https://community.oracle.com/thread/658561?start=15&tstart=0

你可能感兴趣的:(oracle,jdbc)