In many cases, storing large strings or binary data such as pictures hibernate also provides support for BLOBs and CLOB types
BLOB storage is suitable for storing binary data, such as image file Clob using multibyte storage suitable for saving large text, etc.
In MSSQL, image and ntext respectively correspond to blobs and CLOB.
Table mapping file for two types of writing
The mapping type for BLOB format
Recently, the company project, there is a file export (download) function, of course, ordinary download way, such as access to a background file flow address, directly generate the corresponding file, download can, address bar can also carry some control parameters, such as? a=1b=2), but the API interface for this project, Are adopted in the headers of the control parameters, so it can only be used in other ways.
So, after considering, through the Ajax way to request to the background of the bin
oracle| string
1, in the database to build a new table for testing.CREATE Tbale Tb_test(ID number,BLB BLOB);COMMIT;
2. Insert a new record into the Tb_test table for testing.INSERT into Tb_test VALUES (1, Empty_blob ());COMMIT;NOTE: Insert a new record into a data table with a BLOB type field, and you cannot fill in the value directly, you must first insert a empty_blob () into the
Test resultsMySQL Version number 5.1Table type: InnoDB, Row_format=compact (this is the default row format)Inserting more than 10 blobs, the BLOB has a very small amount of data (Inserting more than 10 blobs, the BLOB has a very large amount of data (>768 bytes), insert failed: reported Got error 139 from storage engine.Note that assuming the MySQLServer version number is 5.1, the Innodb_file_format option
Test conclusionMySQL version 5.1Table type: InnoDB, Row_format=compact (this is the default row format)Inserting more than 10 blobs, the BLOB has a small amount of data (Inserting more than 10 blobs, the BLOB has a large amount of data (>768 bytes), insert failed: reported Got error 139 from storage engine.Note that if the MySQL server version is 5.1, the Innodb_file_format option does not exist and there i
The following articles mainly describe how MySQL operates blob. If you are puzzled by the actual operations on blob in MySQL, you can use the following articles to understand the actual application and functions. The following is a detailed description of the article. I hope you will gain some benefits after browsing the following content. Jsp (preferred for SUN Enterprise Applications) + MySQL (matching wi
The first step is to prepare a database:
We need to set the binary field to the Blob type, and select the appropriate Blob type based on the file size. The following figure shows the size of each Blob type that can accommodate binary files.
Four BLOB types in MySQL
Type size (unit: bytes)
TinyBlob Max. 255
Tags: database optimization records knowledge point space impactIn the database optimization, we see some of the tables are designed to use text or BLOB fields, if the single table storage space reached nearly hundred g or dozens of G, this situation again to change and optimization is very difficultFirst, IntroductionIn order to understand the performance impact of large segments, it is necessary to know how the InnoDB storage engine is handled:1, so
The first step is to prepare a database:We need to set the binary field to the Blob type, and select the appropriate Blob type based on the file size. The following figure shows the size of each Blob type that can accommodate binary files.Four BLOB types in MySQLType size (unit: bytes)TinyBlob Max. 255Blob Max 65 KMedi
Mybatis stores and reads data from BLOB-type oracle fields, and mybatisblob
1. BLOB FieldBLOB refers to the writing of a Binary Large Object, that is, the English Binary Large Object, and CLOB refers to the writing of a Large Character Object, that is, the English Character Large Object. BLOB is used to store a large amount of binary data, and CLOB is used to sto
Some data is used for testing, but I think the function is basically implemented. The method for inserting clob or blob is also attached. I also made some modifications on it.
Which can insert both clob and blob
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 /**/ /// 2 /// Write both clob and blob
Blob, inputstream, and byte Conversion
Java is often used in our program development. SQL. blob, byte [], and inputstream are mutually converted. However, in JDK APIs, no available APIs are provided directly, the following program snippets mainly implement util interchange between them.1. byte [] => blobWe can use the statement method provided by hibernate to achieve the following:Org. hibernate
[Author]: KwuSqoop handles Clob and Blob fields, Clob as large text in Oracle. The blob stores the binary file. This type of field is encountered when importing hive or HDFS requires special handling.1. measured frequently in OracleCREATE TABLE t_lob ( A INTEGER, B CLOB, C BLOB )Test dataInsert into T_lob (A, B, C) VALUES (1, ' Clob
Development Environment: Windows XP Professional SP3, vs2008, winform, mysql5.0, MySQL. data6.2.3.0
1. Read an image from the hard disk, convert it to a stream, and store it in this blob field.
View plaincopy to clipboardprint?
Private void button#click (Object sender, eventargs E)
{
Byte [] bytes = NULL;
Bytes = file. readallbytes (@ "C:/Documents and Settings/user/My Documents ents/my pictures/11.jpg ");
Using (MySQL. Data. mysqlclient. mysql
Blob (Binary Large Object), a large binary object, is a container that can store binary files.
In computer systems, blob is often the field type used to store binary files in databases.
Blob is a large file. A typical blob is an image or sound file. due to their size, it must be processed in a special way (for example:
Does Operations on blob fields in Oracle produce a large number of redo operations?
Check whether the blob field produces a large number of redo operations. The answer is no. Here is an experiment to test whether the Oracle database version is 11.2.0.1.0:
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian-- Create a table for testingCre
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.