Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2002

    Post Unanswered: Problem in getBlob()

    Hi, I'm having problem in uploading an image file to the DB2 database. My jdbc is 2.0. The following is the code:

    String sql = ("insert into myblobtable(file_number, uploaded_file) values ("+ fileNumber + ", null)");
    String sql1 = ("select * from myblobtable");

    try {
    poolMgr = PoolManager.getInstance();
    System.out.println("DBUtils...poolMgr instantiated");
    conn = poolMgr.getConnection();
    System.out.println("DBUtils...conn instantiated");
    String colName = "Uploaded_File";
    stmt = conn.createStatement();
    System.out.println("DBUtils...stmt instantiated");
    rst = stmt.executeQuery(sql);
    rst1 = stmt.executeQuery(sql1);
    System.out.println("DBUtils...query executed");
    while ({
    System.out.println("B4 blob");
    Blob blob = rst1.getBlob(colName);
    System.out.println("In blob");
    System.out.println(blob== null? "null" : "not null");
    //catch the exception as usual

    The message is printed until "B4 blob" only and I received the following error message when I'm trying to call this function.

    Root Error-1: COM/ibm/db2/jdbc/app/DB2ResultSet.getBlob
    java.lang.AbstractMethodError: COM/ibm/db2/jdbc/app/DB2ResultSet.getBlob at upload.UploadBean.uploadToDb( at upload.myUploadServlet.processRequest(myUploadServ at upload.myUploadServlet.doPost

    Why I can't use getBlob()? Do you know how to resolve this problem? I really can't figure it out why this happen? I have searched through DB2 book, the example in the book is using getBlob().

    Thank you in advance

  2. #2
    Join Date
    Jan 2003
    Did anyone get a solution to this?
    I am having the same problem


  3. #3
    Join Date
    Aug 2002
    Could it be that you use jdbc 1.0 on your DB2? It is the default JDBC driver used by DB2. To switch to jdbc2.0, you may run usejdbc2.bat if you are using the windows version. Hope this helps.

  4. #4
    Join Date
    Jan 2003
    I tried running usejdbc2.bat but it didn't solve the problem.
    Thanks for your suggestion.


  5. #5
    Join Date
    Dec 2002
    You have to try this to get rid of these problems -
    1) Ensure that u r using JDBC 2.0 - run use jdbc2.bat after closing all db2 services
    2) Apply FixPack 5 or above for Db2 versions 7.1 & 7.2

    This will solve ur problem

Posting Permissions

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