* Toward CLOB Write data to the image */īufferedWriter out = new BufferedWriter(clob.getCharacterOutputStream()) īufferedReader in = new BufferedReader(new FileReader(infile)) Ģ. ResultSet rs = stmt.executeQuery('SELECT CLOBCOL FROM TEST_CLOB WHERE ID='111' FOR UPDATE') Stmt.executeUpdate('INSERT INTO TEST_CLOB VALUES ('111', EMPTY_CLOB())') Public static void clobInsert(String infile) throws Exceptionīoolean defaultCommit = conn.getAutoCommit()
Insert a new CLOB object into the database The SQL statement for building the table is:ĬREATE TABLE TEST_CLOB ( ID NUMBER(3), CLOBCOL CLOB)ĬREATE TABLE TEST_BLOB ( ID NUMBER(3), BLOBCOL BLOB)ġ.
The Power Designer PD model is as follows: The following program examples illustrate several cases of manipulating LOB type fields in Oracle database through JDBC.įirst, establish the following two database tables for testing. CLOB, that is, large object of character type (Character Large Object), is related to character set and suitable for storing text-type data (such as historical archives, large works, etc.). LOB is divided into two types: BLOB and CLOB: BLOB is binary large object (Binary Large Object), which is suitable for storing non-text byte stream data (such as program, image, audio and video, etc.).