尝试在数据库中加载 blob 时,为什么会出现 java.lang.AbstractMethodError 错误? [英] Why do I get java.lang.AbstractMethodError when trying to load a blob in the db?

查看:30
本文介绍了尝试在数据库中加载 blob 时,为什么会出现 java.lang.AbstractMethodError 错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 JDBC 有问题.

I've got a problem with JDBC.

我有以下代码:

//blargeparam is a blob column.
PreparedStatement pst =connection.prepareStatement("update gcp_processparams_log set blargeparam= ? where idprocessparamslog=1");

pst.setBinaryStream(1,inputStream);         

我收到以下错误:

Exception in thread "main" java.lang.AbstractMethodError:           
oracle.jdbc.driver.T2CPreparedStatement.setBinaryStream(ILjava/io/InputStream;)V  

我的连接字符串是jdbc:oracle:oci:@.....

Oracle 版本是 11g.

The Oracle version is 11g.

从错误消息中似乎缺少一些东西但是:

From the error message it seems that something is missing but:

  • 当我从同一个 blob 列中读取时(使用 blob.getBytes)一切工作.
  • 即时客户端的 DLL 是(正确)在库路径中.
  • 这是Oracle的清单我的类路径中的 JDBC JAR:

  • when I read from the same blob column (with blob.getBytes) everything works.
  • The DLL's of the instant client are (correctly) in the library path.
  • This is the manifest of the Oracle JDBC JAR in my class path:

Manifest-Version: 1.0  
Specification-Title:    Oracle JDBC driver classes for use with JDK14  
Sealed: true  
Created-By: 1.4.2_14 (Sun Microsystems Inc.)  
Implementation-Title:   ojdbc14.jar  
Specification-Vendor:   Oracle Corporation  
Specification-Version:  Oracle JDBC Driver version - "10.2.0.4.0"  
Implementation-Version: Oracle JDBC Driver version - "10.2.0.4.0"  
Implementation-Vendor:  Oracle Corporation  
Implementation-Time:    Sat Feb  2 11:40:29 2008  

推荐答案

看起来即使驱动 10.2 兼容 JDBC3 也可能不适用于 JRE6正如我在这里找到的:

It looks that even if the driver 10.2 is compatible with the JDBC3 it may not work with JRE6 as I've found here:

http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#02_03

哪些 JDBC 驱动程序支持哪些版本的 Javasoft JDK?

Which JDBC drivers support which versions of Javasoft's JDK?

8i 之前的 OCI 和 THIN 驱动程序 - JDK 1.0.x 和 JDK 1.1.x
8.1.5 OCI 和 THIN 驱动程序 - JDK 1.0.x 和 JDK 1.1.x
8.1.6SDK 瘦驱动程序 - JDK 1.1.x 和 JDK 1.2.x(又名 Java2)
8.1.6SDK OCI 驱动程序 - 仅 JDK 1.1.x
8.1.6 OCI 和 THIN 驱动程序 - JDK 1.1.x 和 JDK 1.2.x
8.1.7 OCI 和 THIN 驱动程序 - JDK 1.1.x 和 JDK 1.2.x
9.0.1 OCI 和 THIN 驱动程序 - JDK 1.1.x、JDK 1.2.x 和 JDK 1.3.x
9.2.0 OCI 和 THIN 驱动程序 - JDK 1.1.x、JDK 1.2.x、JDK 1.3.x 和 JDK 1.4.x
10.1.0 OCI 和 THIN 驱动程序 - JDK 1.2.x、JDK 1.3.x 和 JDK 1.4.x
10.2.0 OCI 和 THIN 驱动程序 - JDK 1.2.x、JDK 1.3.x、JDK 1.4.x 和 JDK 5.0.x
11.1.0 OCI 和 THIN 驱动程序 - JDK 1.5.x 和 JDK 1.6.x

pre-8i OCI and THIN Drivers - JDK 1.0.x and JDK 1.1.x
8.1.5 OCI and THIN Drivers - JDK 1.0.x and JDK 1.1.x
8.1.6SDK THIN Driver - JDK 1.1.x and JDK 1.2.x (aka Java2)
8.1.6SDK OCI Driver - Only JDK 1.1.x
8.1.6 OCI and THIN Driver - JDK 1.1.x and JDK 1.2.x
8.1.7 OCI and THIN Driver - JDK 1.1.x and JDK 1.2.x
9.0.1 OCI and THIN Driver - JDK 1.1.x, JDK 1.2.x and JDK 1.3.x
9.2.0 OCI and THIN Driver - JDK 1.1.x, JDK 1.2.x, JDK 1.3.x, and JDK 1.4.x
10.1.0 OCI and THIN Driver - JDK 1.2.x, JDK 1.3.x, and JDK 1.4.x
10.2.0 OCI and THIN Driver - JDK 1.2.x, JDK 1.3.x, JDK 1.4.x, and JDK 5.0.x
11.1.0 OCI and THIN Driver - JDK 1.5.x and JDK 1.6.x

Oracle 10.2.0 支持:

Oracle 10.2.0 supports:

完全支持 JDBC 3.0
请注意,数据库中对以下内容的支持没有真正的变化.所有改变的是,以前抛出 SQLException 的一些方法现在做了更合理的事情.
结果集的可持有性
返回多个结果集.

Full support for JDBC 3.0
Note that there is no real change in the support for the following in the database. Allthat has changed is that some methods that previously threw SQLException now do something more reasonable instead.
result-set holdability
returning multiple result-sets.

这篇关于尝试在数据库中加载 blob 时,为什么会出现 java.lang.AbstractMethodError 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆