1.EMPTY_BLOB()和EMPTY_CLOB()
这两个函数都是用来对大数据类型字段进行初始化操作的函数
2.BFILENAME(dir,file)
指定一个外部二进制文件(它是File类型)
SQL>insert into file_tb1 values(bfilename('lob_dir1','image1.gif'));
Blob类型读取:
Blob blob = rs.getBlob(index);;
if (blob!=null);{
byte buf[] = new byte[(int);blob.length();];;
InputStream in = blob.getBinaryStream();;
try {
in.read(buf);;
} catch (IOException e); {
throw new SQLException();;
}
}
Clob数据类型读取:
Clob clob = rs.getClob(index);;
if (clob!=null);{
char buf[] = new char[(int);clob.length();];
Reader reader = rs.getClob(index);.getCharacterStream();;
try {
reader.read(buf);;
} catch (IOException e); {
throw new SQLException();;
}