---
title: "ORA-01483: invalid length for DATE or NUMBER bind variable"
author: "sjsky"
date: "2011-03-16T13:23:41Z"
tags: ["Hibernate", "JDBC", "Java", "Oracle", "SQL"]
categories: ["编程语言"]
slug: "ora-01483-invalid-length-for-date-or-number-bind-variable"
draft: false
lastmod: "2012-02-20T10:02:19Z"
id: 964051
url: "https://sjsky.iteye.com/blog/964051"
---

<span style="color:red">blog迁移至</span>:[http://www.micmiu.com](http://www.micmiu.com)

记录工作中解决问题的点滴，希望能给初次遇到相同问题的XD提供帮助。
<span style="color:blue"></span>
开发环境
OS： Windows Vista
DB：Oracle11g
现网环境
OS： Windows Server 2008
DB：Oracle9i
<span style="color:red">发生异常的字段属性</span>：名称：remark  类型：varchar2(4000)
<span style="color:blue"></span>
<span style="color:red">remark字段如果输入超过大概1000个字符，现网环境就会报错，开发环境正常，具体错误信息如下：</span>

```java

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

```

<span style="color:blue"></span>
经网上搜索资料和测试验证，应该是oracle的驱动ojdbcxx.jar包和当前的数据库不匹配造成的,只要更换驱动包就可解决该问题。具体对应的包可以在oracle安装目录中 jdbc\lib下找到当前版本的ojdbcxx.jar包。附件提供各版本oracle的ojdbc驱动下载包：

[ojdbc14_9i_.jar](http://dl.iteye.com/topics/download/c8389ea3-8f03-342d-9dae-66de61a235fb)
[ojdbc14_10g_.jar](http://dl.iteye.com/topics/download/fa4d8bc2-1120-3980-95fd-c314b0754e95)
[ojdbc6_11g_.jar](http://dl.iteye.com/topics/download/21da0353-cad7-3fea-b34d-aeeee4a0b20d) 
查看数据库的当前版本：
```sql
select * from v$version;
```

查看ojdbcxx.jar的版本信息：解压软件打开ojdbcxx.jar，找到META-INF/MANIFEST.MF，具体内容如下：
<span style="color:blue">oracle 11g的ojbc6.jar中MANIFEST.MF信息如下</span>

```java
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

```

<span style="color:blue">oracle 10g的ojbc14.jar中MANIFEST.MF信息如下</span>

```java
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
```

<span style="color:blue">oracle 9i的ojbc14.jar中MANIFEST.MF信息如下</span>

```java
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"
```



-----------------------------------分 ------------------------------------隔 ------------------------------------线 --------------------------------------