Solved

Java setBinaryStream

Posted on 2014-10-10
3
296 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 20

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now