Re: Java on iSeries: setBinaryStream problem
From: Joe Weinstein (joeNOSPAM_at_bea.com)
Date: 10/13/04
- Previous message: SteveE: "Re: Unable to load JdbcOdbc library"
- In reply to: Robert Schneider: "Re: Java on iSeries: setBinaryStream problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 13 Oct 2004 08:51:51 -0700
Robert Schneider wrote:
> Thank you for your answer.
>
> Now I found out that the programm didn't use the native db2 driver.
> This was a mistake by myself. So it has used the pure java driver. And
> now I changed this and now it fortunately works!
>
> But I'm still wondering why the pure java driver does not work. Do you
> know why?
>
> Robert
If you do what I suggested we will know more. Get it to hang, then get a thread dump
so we can see what the client is waiting on. Then check the DBMS to see what it
thinks is happening on the connection. This sounds like a bug in the all-java
driver.
Joe Weinstein at BEA
>
>
>
>
>
>
>
>
> Am Tue, 12 Oct 2004 09:00:20 -0700 schrieb Joe Weinstein
> <joeNOSPAM@bea.com>:
>
>>
>> Hi. Nothing's wrong with the code. Get a thread dump to see what is
>> hanging.
>> It soulds like the client library has a bug, or... when this happens, get
>> your DBA to tell you what the DBMS thinks is happening on that
>> connection.
>> What happens if you try using a type-4 (all Java) jdbc driver?
>> Joe Weinstein at BEA
>>
>> Robert Schneider wrote:
>>
>>> Hi,
>>> I have got a problem inserting data of a file (both, binary and
>>> text) into a blob column. It is created with "Data BLOB(2G)" in the
>>> sql statement (so the name of the column is obviously 'Data'). I
>>> use a PreparedStatement with the method setBinaryStream. And as far
>>> as i can remember it already had worked until... hm, that's the
>>> question! The problem is now that I'm able to insert files with a
>>> size of about 400k. I don't know the exact size. I have tried it
>>> with a 530k-file and this does not work. What happens is that the
>>> method hangs. It does not return anymore. But I'm almost sure that
>>> this has already worked a while ago. But I can not find out what
>>> has changed (in my opinion nothing has changed, so I'm suprised
>>> about this).
>>> The code:
>>> FileInputStream fis = new FileInputStream(aFileObject);
>>> BufferedInputStream bis = new BufferedInputStream(fis);
>>> psNewDoc.setString(1, docID);
>>> psNewDoc.setString(2, mime);
>>> psNewDoc.setInt(3, seq);
>>> psNewDoc.setBinaryStream(4, bis, (int) aFileObject.length());
>>> psNewDoc.executeUpdate();
>>> What could be wrong with this? Nothing?
>>> The programm runs on a as400/V5R2 with the jt400 library. The db2
>>> driver is used, not the pure java version.
>>> Thanks for any hint,
>>> Robert
>>
>>
>
- Previous message: SteveE: "Re: Unable to load JdbcOdbc library"
- In reply to: Robert Schneider: "Re: Java on iSeries: setBinaryStream problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|