Re: Java on iSeries: setBinaryStream problem

From: Joe Weinstein (joeNOSPAM_at_bea.com)
Date: 10/13/04

  • Next message: Oscar kind: "Re: Detecting if a table in a database already exists ?"
    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
    >>
    >>
    >


  • Next message: Oscar kind: "Re: Detecting if a table in a database already exists ?"

    Relevant Pages

    • Re: Sp_CursorOpen,Fetch,Close
      ... It means the driver is asking the dbms to execute the procedure ... Joe Weinstein at BEA ...
      (microsoft.public.sqlserver.jdbcdriver)
    • Re: Java on iSeries: setBinaryStream problem
      ... seems a driver bug to me; try the newest version of ... the driver ... Robert Schneider wrote: ... > But I'm still wondering why the pure java driver does not work. ...
      (comp.lang.java.databases)
    • Re: Java vs SQL Server float datatype limits
      ... However Java double has a much wider range: ... Joe Weinstein at BEA Systems ... So I would have imagined that an SQL Server driver either handle the ... The JDBC specification says something about the driver being expected to coerce the Java data type into the correct data type for the server the driver is representing. ...
      (microsoft.public.sqlserver.jdbcdriver)
    • Re: JDBC and JVM question
      ... > public SybDriver() ... > change of regime in DriverManager from one perfectly good driver instance ... > Joe Weinstein at BEA ... There would be no need for the registerWithDriverManager() routine. ...
      (comp.lang.java.databases)
    • Re: ResultSet.updateString against DB2 giving "Column not updatable"
      ... I just based my conclusion on the obvious driver response ... program that makes a JDBC connection, creates a table, inserts ... Check the driver documents about this. ... Joe Weinstein at BEA Systems ...
      (comp.lang.java.databases)