Oracle defines a BLOB field for storing binary data, but this field does not hold true binary data, can only Gencun a pointer to the word, and then places the data in the LOB segment of Oracle to which the pointer points, and the LOB segment is part of the database's internal table.
Therefore, before manipulating an Oracle blob, the pointer (the locator) must be obtained before the BLOB data can be read and written.
How do I get a blob pointer in a table? You can use the INSERT statement to insert an empty blob into the table (call Oracle's function Empty_blob ()), which creates a pointer to the BLOB, and then queries the pointer for the empty BLOB so that you can get the Blob object. To read and write BLOB data.
Insert an empty BLOB insert into Test (id,image) http://www.aliyun.com/zixun/aggregation/9541.html ">values (?, Empty_blob ()); Cursor Select image from Test where id= to get a blob? for update; Blob B = Rs.getblob ("image") Note: You must add a for update to lock the row until the row has been modified to ensure no concurrency conflict.
Use IO, and get cursor to read and write data to the database note: The above operations need to open the transaction.