Solved

Java setBinaryStream

Posted on 2014-10-10
3
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

630 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