Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2006

    Unanswered: Retrieve BLOB from z/OS


    I am trying to retrieve BLOB from DB2 V8.1 on z/OS to a file
    on z/Linux using DB2 Connect as below, but it doesn't work
    (this works well for DB2 UDB on Windows):

    String query = "SELECT images FROM some_table";
    ResultSet rs = stmt.executeQuery(query);
    InputStream is = rs.getBinaryStream("images");
    bin = new BufferedInputStream(is);
    byte buf[] = new byte[1024];
    int c = 0;
    while(true) {
    c =, 0, buf.length);  //<-- error occured
    if(c == -1) break;
    bos.write(buf, 0, c);

    Caused by: DB2Exception: [IBM][JDBC Driver] CLI0620E IOException, error reading from input stream. SQLSTATE=428A1
    at Code))

    I am going to use getBlob() instead of getBinaryStream(),
    but does anyone know the solution.

    Any help appreciated,

    Last edited by keitadj; 10-05-06 at 08:53.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts