blob数据是存储大对象数据类型, 一般存放二进制的,所以才用字节存取。
首先判断blob数据是否为空,然后采用输入流读出数据,具体代码如下:
String content = null;
? try {
? if(image != null){
? ? InputStream is = image.getBinaryStream();
? ? byte[] b = new byte[is.available()];
? ? is.read(b, 0, b.length);
? ? content = new String(b);
? }
? System.out.println(content);
? } catch ( IOException e) {
? e.printStackTrace();
? }