记录工作中解决问题的点滴,希望能给初次遇到相同问题的XD提供帮助。
[环境信息]
开发环境
OS: Windows Vista
DB:Oracle11g
现网环境
OS: Windows Server 2008
DB:Oracle9i
发生异常的字段属性:名称:remark 类型:varchar2(4000)
[错误现象]
remark字段如果输入超过大概1000个字符,现网环境就会报错,开发环境正常,具体错误信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
JDBCExceptionReporter - SQL Error: 1483, SQLState: 72000 JDBCExceptionReporter - ORA-01483: invalid length for DATE or NUMBER bind variable AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update 省略。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 省略。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 Caused by: java.sql.BatchUpdateException: ORA-01483: invalid length for DATE or NUMBER bind variable at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343) at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10720) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246) ... 48 more |
[解决方案]
经网上搜索资料和测试验证,应该是oracle的驱动ojdbcxx.jar包和当前的数据库不匹配造成的,只要更换驱动包就可解决该问题。具体对应的包可以在oracle安装目录中 jdbc\lib下找到当前版本的ojdbcxx.jar包。附件提供各版本oracle的ojdbc驱动下载包:
查看数据库的当前版本:
1 |
select * from v$version; |
查看ojdbcxx.jar的版本信息:解压软件打开ojdbcxx.jar,找到META-INF/MANIFEST.MF,具体内容如下:
oracle 11g的ojbc6.jar中MANIFEST.MF信息如下
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Manifest-Version: 1.0 Implementation-Vendor: Oracle Corporation Implementation-Title: ojdbc6.jar Implementation-Version: Oracle JDBC Driver version - "11.1.0.7.0-Produ ction" Implementation-Time: Wed Sep 17 16:40:39 2008 Specification-Vendor: Oracle Corporation Sealed: true 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 |
oracle 10g的ojbc14.jar中MANIFEST.MF信息如下:
1 2 3 4 5 6 7 8 9 10 |
Manifest-Version: 1.0 Specification-Title: Oracle JDBC driver classes for use with JDK14 Sealed: true Created-By: 1.4.2_08 (Sun Microsystems Inc.) Implementation-Title: ojdbc14.jar Specification-Vendor: Oracle Corporation Specification-Version: Oracle JDBC Driver version - "10.2.0.3.0" Implementation-Version: Oracle JDBC Driver version - "10.2.0.3.0" Implementation-Vendor: Oracle Corporation Implementation-Time: Fri Sep 29 09:43:24 2006 |
oracle 9i的ojbc14.jar中MANIFEST.MF信息如下:
1 2 3 4 5 6 7 8 |
Manifest-Version: 1.0 Specification-Title: "Oracle JDBC driver classes for use with JDK1.4" Specification-Version: "Oracle JDBC Driver version - 9.0.2.0.0" Specification-Vendor: "Oracle Corporation" . Implementation-Title: "ojdbc14.jar" Implementation-Version: "Oracle JDBC Driver version - 9.0.2.0.0" Implementation-Vendor: "Oracle Corporation" Implementation-Time: "Thu Apr 25 23:14:02 2002" |
原创文章,转载请注明: 转载自micmiu – 软件开发+生活点滴[ http://www.micmiu.com/ ]
本文链接地址: http://www.micmiu.com/exception/ora-01483-invalid-length/
0 条评论。