ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vanessa" <vanessaboss...@telenet.be>
Subject Problem with blob
Date Tue, 14 Aug 2007 06:36:14 GMT
Hello everyone

I have the next problem what I cannot solve.
I have a web application that displays blobs to the users.
I have written the code myself and when I execute it, I get an ERROR 500. java.lang.IndexOutOfBoundsException
The problem is, when I have for example 20 blobs that the users can see, al the blobs that
are stock in the database with length 65000 are displayed and the one with 59056 gives the
ERROR 500 java.lang.IndexOutOfBoundsException  error.

This is the code I have developed for displaying the blob: 


public byte[] byteread = new byte[65000];

public boolean readStudentHtml(String key) throws Exception {

    try {
	Etc….

      If Etc… {
        for Etc….  {

        Object currentBlob = ((model.StudentHtml)resultList.get(i)).getAttest();
          if (currentBlob != null) {
            byteread = ((model.StudentHtml)resultList.get(0)).getAttest();
            logger.trace("Blob found for : " + key);
            return true;
          } else {
            logger.error("Blob not found for : " + key);
            return false;
          }
        }
        } else {
          logger.error("Blob not found for : " + key);
      }
    } catch (Exception e) {
      logger.trace("Error readStudentHtml : Cause : " + e);
      e.printStackTrace();
    }
    return false;
  }


Can someone help me.
Vanessa




Mime
View raw message