Recently, in J2EE projects, you need to save text information and pictures and files in J2EE. You have searched it online, there are still a lot, look at it carefully, but you are not very full, there are mistakes, after a few days of practice, Solve the problem, and conclude it, I hope to be aware of the needs of the friends.
There are two main CLOBs and BLOBs we use in LOB, we discuss two types
1.Clob is a characteristic LOB, mainly stores text information, the longest
4G
In the J2EE program, the character information in the textarea in the web page is relatively long. When the VARCHAR2 field type cannot be satisfied, we have to use the Clob data type, and our project will encounter this situation. Now let's talk How to access a Clob field
Now I want to save the information of the textarea element in the web page into the clob field of the database, we all know that the information in the textarea can certainly not be directly saved into clob, we get the String type in the background, not to say, we still Take an example!
Built first in the Test table, the table has 2 fields: ID, Contents, where Contents saves the text data for the Clob type.
Create Table Test (ID Varchar2 (18) Not Null, Contents Clob,)
Then we write a Test JSP file clobtest.jsp, code as follows