Code example for Blob

Methods: getBytes, length

0
	} 
	 
	public void setImage(Blob imageAsBlob) throws Exception {
		if(imageAsBlob!=null) {
			blob = imageAsBlob;
			if(imageAsBlob.length()==0) {
				imageAsBytes=null;
				image.setIcon(null);
			} else { 
				imageAsBytes = imageAsBlob.getBytes(1L, (int)imageAsBlob.length());
				image.setIcon(new ImageIcon(imageAsBytes));
			} 
		} else { 
			reset(); 
		} 
	}	 
	 
	public Blob getImage() {
		return blob;
	}