My interface definition:
int Insertabilitypackageconsumer (Abilitypackageconsumer abilitypackageconsumer);
My entry entity length is this: (To reduce the amount of code, I only put the attribute)
public class Abilitypackageconsumer implements serializable{
/**
* */
private static final long Serialversionuid = 7922942036926940889L;
Private long appid;//Application ID private long
abilitypackageid;//capability package ID
private long abilityid;//capability ID
Private Long abilityruleid
Suppose our table structure is as follows
The code is as follows
Copy Code
CREATE TABLE Example (example_id INT not NULL,Name VARCHAR not NULL,Value VARCHAR is not NULL,Other_value VARCHAR (m) not NULL)
Typically, a single inserted SQL statement will write this:
The code is as follows
Copy Code
INSERT into example(example_id, name, value, O
It was always said that bulk INSERT and update efficiency is higher than non-bulk, but has not used the bulk processing of data, and now because the project needs to deal with a large amount of data, so the use of bulk processing features, Java code is as follows:1.java impl
; - } the } - Wuyi Use the SqlBulkCopy class to write data to a SQL Server table only. However, the data source is not limited to SQL Server; You can use any data source, as long as the data can be loaded into a DataTable instance or you can use a IDataReader instance to read the data. theFrom //ww
To do a bulk INSERT database, you first need to know the syntax that the database supports for bulk INSERT. The syntax for bulk inserts for each database is different, and I introduce two.Mysql:1, INSERT into table_name (id,name)
Tags: service export data dump export pre mys MySQL full valuesThis is the advanced settings for MySQL same server type data transferWhen you select a database, right-click Dump SQL file the default export record format is a strip of the "full insert statement" in the following formatINSERT into' User ' (' ID number ', ' username ', ' age ')VALUES('1','Liang Min
When you use SQLite to store data, you find that the insertion speed is too slow and the program has been running for almost five minutes before inserting less than 3,000. Online search data only found thatsqlite this file database and the MySQL mechanism is different, each transaction has to open and close the file steps, SQLite by default, each statement as a separate transaction. When I insert data, there will be a lot of file IO operation, the eff
When you use the Oracle driver OJDBC14 package for bulk inserts, you encounter an insert problem when you encounter a 65,536 number of bars, causing subsequent inserts to fail, and you need to work with the data in the
Group operation, so that the number of bars per execution does not exceed 65,536, the following is a batch of Oracle data inserted in the sample code.
1.
Tags: except nal print simple false time not Java user In the recent process of processing a batch of data, the fields from the table in the library need to be processed and exported to a new table. Only the amount of data in this table is nearly 500w.The problem with this amount of data is that it has to be handled for a long time.First think, a sentence of the insertion, large data processing time is long, ignore.Next think, multi-threaded INSERT, t
Back to CatalogBulk INSERT in the EF era, the uncle has encapsulated itself, the principle is to reduce the number of SQL connections and the number of instructions sent to SQL to 1 times, or 1000 data 1 times, and for the statement generated by EF, this is undoubtedly performance-efficient, because the EF side when processing, each statement will be sent to
Label:
8 seconds to add 20,000 data in bulk.
try {
String url = "Jdbc:oracle:thin: @IP: 1521:ORCL"; //ORCL is the SID of the database
String user = "Oracle";
String password = "Oracle";
StringBuffer sql = new StringBuffer ();
Sql.append ("INSERT into Ex_log (ex_log_id,ex_log_date) VALUES (?,?)");
Class.forName ("Oracle.jdbc.driver.
Tags: ber test char values SQL MySQL load data name speedOriginal: http://www.open-open.com/code/view/1453702496573MySQL Batch insertion BULK insert and load data are almost as fast and reliable.The syntax is as followsSuppose there is a table test (ID number,name VARCHAR (10))INSERT into test values (1, ' AA '), (2, '
To intercept some log information:2015-09-01 14:48:47,132 INFO [Org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-Loading XML bean Definitions from class path resource [Org/springframework/jdbc/support/sql-error-codes.xml]2015-09-01 14:48:47,178 INFO [org.springframework.jdbc.support.SQLErrorCodesFactory]-Sqlerrorcodes loaded: [DB2, Derby, H2, HSQL, Informix, Ms-sql, MySQL, Oracle, PostgreSQL,
Label: conn =mysqljdbcutils.getconnection (); Statement PS=conn.createstatement (); Ps.addbatch ("Truncate Qb_showcount_asite_copy");
Ps.executebatch (); String Srcsql= "SELECT Convert" (Unhex (Hex (CONVERT (Community using latin1)) using UTF8) as Community, PID from Qb_menbercmmsets_list whe Re site=7 "; stmt=conn.preparestatement (Srcsql); RS=Stmt.executequery (); Above is the empty command that executes before the following SQL statement executes//
Label:Many times we need to insert data from a TXT, XML, Excel, and other files into the table specified in the database. Using traditional read data to construct SQL statement insert performance is slow (should be performed frequently exectuenonquery method), especially when the amount of data is very large, this method does not meet our needs, then Microsoft pr
Tags: des style blog http io ar color OS spIn general, we use INSERT statements when inserting data into a database, but when the amount of data is large, this is a slow situation, and this is the time to sqlbulkcopy this class.There are so few functions that are commonly used by SqlBulkCopy itself.DestinationTableName-----The name on the server target table, which table you want to
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.