Solved

Java setBinaryStream

Posted on 2014-10-10
3
326 Views
Last Modified: 2015-05-12
In writing files to a Sybase table, we are using PreparedStatement.setBinaryStream.  There are different  versions of this method, and we want to use the one where we can just pass an InputStream, along with the colIndex.

But when we use the setBinaryStream(int, InputStream) method, there's an AbstractMethodError.  Looking into this, it may be because "our JDBC driver implements an older version of the JDBC API than the one included in our JRE."  But we are using jconn4.jar and Java 1.6.0, which seem to be recent enough.  We are running the application in WebSphere 8.5.0.2.

Does anyone know what might be going on here?
0
Comment
Question by:jkavx
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
ID: 40374445
The setBinaryStream(int, InputStream) is introduced in java 6. And, you identified correctly it is compatibility issue. Since jconn4.jar is older one, it may not be compatible with java 6. Check which version of JDBC driver is used and it is compatible with Java 6.

Solution to upgrade your JDBC driver as well as other APIs if it is not compatible with Java 6.
0
 

Author Comment

by:jkavx
ID: 40374451
I'm not sure how to check the version of JDBC driver.   I don't have %JDBC_HOME% locally, and don't see $JDBC_HOME on the application server.
0
 

Author Comment

by:jkavx
ID: 40374457
OK.
c:\svn\java\main\WebContent\WEB-INF\lib>java -jar jconn4.jar
jConnect (TM) for JDBC(TM)/7.07 ESD #5 (Build 26792)/P/EBF20686/JDK 1.6.0/jdbcmain/OPT/Mon Oct 15 11:36:14 PDT 2012

so this seems to be 7.07 which should be fine.  I'm thinking that jconn4.jar is fairly recent.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question