Solved

Java setBinaryStream

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle 11g 23 106
login form jsp example 2 35
jmss example java 2 23
jsp error 6 25
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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:

809 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