/* 查询此CLOB对象并锁定 */
rs = stmt.executeQuery(
"SELECT MoviePicture FROM movie1 WHERE MovieID='1' FOR UPDATE");
if (rs.next()) {
/* 取出此CLOB对象 */
BLOB blob = (BLOB) rs.getBlob("MoviePicture");
/* 向BLOB对象中写入数据 */
BufferedOutputStream out = new BufferedOutputStream(blob.
getBinaryOutputStream());
BufferedInputStream in = new BufferedInputStream(new FileInputStream("screen.bmp"));
int c;
while ( (c = in.read()) != -1) {
out.write(c);
}
in.close();
out.close();