Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Java setBinaryStream

Posted on 2014-10-10
3
Medium Priority
?
402 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 2000 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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

824 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