, and then operate on the operator. Empty_blob () function is a needle// For blob type, which corresponds to clob is empty_clob (). Second,// Returns picture so that php oci functions can process it.$ Stmt = ociparse ($ Conn, "insert into pictures (ID, imgtype, description, picture) Values
(Pic_seq.nextval, '$ imgtype', '$ description',' $ lob_upload_type ', empty_blob () Returning picture
Into: Picture ");// Generate the descriptor of a local lob obj
type in the database is Timestamp, the database system will still automatically populate the Timestamp value even if the user inserts the data with a null value3). Types of hibernate mappings for Java large object types
java type
hibernate mapping type
standard SQL type
mysql type
Oracle Type
byte[]
binary
varbinary/blob
BLOB
BLOB
String
text
CLOB
This part is not included in the Itpub Technology series "Oracle Database DBA Technology Highlights," is later added.
As we mentioned earlier, changing the character set by modifying the props$ is an extremely dangerous way to Oracle7, and should be avoided as much as possible.We also know that changing the character set through alter DATABASE CHARACTER set is safe and reliable, but with strict subsets and superset constraints, we rarely can actuallyUse this method.
There is actually another way
Converting a picture to Base64 encoding makes it easy to insert a picture into another page or editor without uploading a file. This is very handy for some small pictures, because you don't need to look for a place to save the pictures.BASE64 encoding is typically stored as CLOB in an Oracle database. The following are the ways in which fields are read and processed by Java for reference.Recently, the Clob
(); Con.commit (); Con.close (); 2, out of the library//get a database connectionConnection con =connectionfactory.getconnection (); Con.setautocommit (false); Statement St=con.createstatement (); //no "for update" requiredResultSet rs = st.executequery ("Select Blobattr from Testblob where id=1"); if(rs.next ()) {java.sql.Blob Blob= Rs.getblob ("blobattr"); InputStream instream=Blob.getbinarystream (); //data is read out and needs to be returned, the type is byte[]data =New byte[input.av
Recently, in the J2EE project, you need to use the LOB field to save text information, images, and files. You can search and pull them online. There are still a lot of errors, after several days of practice, I will solve all the problems. By the way, I hope to provide some reference to the friends who need it.LOB mainly uses two types of CLOB and BLOB. We discuss the two types of CLOB and BLOB respectively.
When adding data to a field with the lob type, use empty_clob () to initialize the clob field, then write data in the output flow field (these data are usually relatively large bytes of traffic ). if you write data directly to the table on the Oracle client, you don't have to worry about it.
Okay. Specific operations:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Create Table article (
Subject varcha
-- Regexp_like -- function regexp_like (srcstr varchar2 Character Set any_cs, pattern varchar2 Character Set srcstr % charset, modifier varchar2 default null) return Boolean; Pragma trim ('regexp _ like ', 1452 ); function regexp_like (srcstr clob Character Set any_cs, pattern varchar2 Character Set srcstr % charset, modifier varchar2 default null) return Boolean; Pragma fipsfla
Oracle Database can be used to search or operate lob data in many ways. We all know that there are four large objects in Oracle Database: lobs, the four types are blob, clob, and bfile and nclob. The following is a brief introduction to the lob data type.
Blob: Binary lob, Which is binary data. It can be up to 4 GB and stored in the database.
Clob: character lob, character data, up to 4 GB, stored in the
I used Oracle (large website database platform) 9i and Oracle (large website database platform) 8. For a long time, I used it for jsp (the preferred choice for SUN enterprise-level applications) for your reference only.
I. How to deal with large types of Clob and BLOB
CLOB can be used to store enlarged text data and store up to 4 GB of data, which is common in application development. SQL provided by java.
When using ORACLE9i and oracle8, what are the problem objects and range attributes that need attention in JSP? Next we will start to explain.
How to process large types of Clob and BLOB with object and range attributes
CLOB can be used to store enlarged text data and store up to 4 GB of data, which is common in application development. SQL provided by java. corresponding to the
Notes for connecting ORACLE databases and JSP-general Linux technology-Linux programming and kernel information. For more information, see the following. I have used ORACLE9i, oracle8 for a long time. I wrote out the issues that need attention in JSP for your reference only.
I. How to deal with large types of Clob and BLOB
CLOB can be used to store enlarged text data and store up to 4 GB of data, which is
is a value from 1 through 8,000. You can easily the find corresponding datatype name "char" in Oracle, but the char in Oracle with a maximum length of $ bytes. So your can ' t migrate char (2048) in your SQL Server script to Oracle without any changes, you should use CLOB instead if n > 2000. In Oracle database, char[(size)] Can is also is used in fixed-length character data of length size in characters. When you use Char qualifier, for example char
implement an automatic increase in IDs, build another sequence:
CREATE SEQUENCE Pic_seq;
PHP Program-Insert Section:
?
$conn =ocilogon ($username, $password, $sid);
Here are two points to note: one is to use the Empty_blob () function. This is Oracle's internal letter.
Number, returns the locator character of a lob. This is the only way to insert a lob, sir.
Empty LOB Locator, and then operate on the locator character. Empty_blob () function is a needle
For a BLOB type, corresponds to the
Label:1. Sysdba the user to assign permissions # Sysprivilege.sql Prompt----Connect to SYSDBA
set serveroutput on;
Prompt----Create user aq and Aq_user
drop user aq cascade;
Drop user aq_user cascade;
Create user aq identified by AQ;
Create user aq_user identified by Aq_user;
Prompt----Grant SYS privilege
grant connect,resource to Aq,aq_user;
Grant aq_administrator_role,unlimited tablespace to AQ;
Grant execute on Dbms_aq to AQ;
Grant execute on Dbms_aqadm to AQ;
Grant Select any dictionary to
ORA-22828 input style or replacement parameter exceeds 32 K size limit
The following error is reported during program debugging today:
ORA-22828: input pattern or replacement parameters exceed 32K size limit22828. 00000 - "input pattern or replacement parameters exceed 32K size limit"*Cause: Value provided for the pattern or replacement string in the form of VARCHAR2 or CLOB for LOB SQL functions exceeded the 32K size limit.*Action: U
Yes_no
Boolean Boolean
CHAR (1) (y-n)
Boolean type
True_false
Boolean Boolean
CHAR (1) (T-F)
Boolean type
2. Hibernate mappings for Java time and date types
Mapping type
Java type
Standard SQL Type
Describe
Date
Util. Date or SQL. Date
DATE
Yyyy-mm-dd
Time
Date time
Time
HH:MM:SS
Timestamp
Date Timestamp
TIMESTAMP
3. Types of hibernate mappings for Java large object types
Map type
style= font-family Times New Roman '; " >java type
Standard sql type
mysql type
oracle type
binary
style= "font-family: ' Times New Roman ';" >byte[]
varbinary ( or blob)
blob
blob
text
style= "font-family: ' Times New Roman ';" >string
code implementation and facilitate deployment.
Database operations are frequently performed in Web applications. Generally, database operations are integrated into a database operation class. You only need to call these methods to perform database operations.
(2) lob object access in Oracle Database
The access to binary files, images, and large text in Web applications in databases is usually implemented with large objects (LOB .. The. NET Framework provides the oraclelob class to perform
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.