An Explanation of MySqlBulkLoader
Can you tell me what MySqlBulkLoader
is for, where and how to use it?
Some 开发者_JAVA百科examples would also be appreciated, please..
MySQLBulkLoader
is a class in the MySQL Connector/Net class that wraps the MySQL statement LOAD DATA INFILE
. This gives MySQL Connector/Net the ability to load a data file from a local or remote host to the server. [MySQLBulkLoader]
The example how to use the MySQLBulkLoader
is also presented Here
To be clear:
The MySQLBulkLoader
is not similar to SQLBulkCopy
. SQLBulkCopy
also called Bulk insert
reads data from DataTable
and MySQLBulkLoader
also called LOAD DATA INFILE
reads from a file. If you have a list of data to insert in you database, it is possible to prepare and insert data inside you database directly with SQLBulkCopy
; where with the MySQLBulkoader
you will need to genereate a file from your data before running the command.
There are no counterpart of SQLBulkCopy
inside MySQL Connector/Net at the time writting; however, the MySQL DB
support Bulk insert
, so you can run the corresponding command in a MySQLCommand
like presented Here.
MySqlBulkLoader
is a class provided by the MySql .net Connector.
It provides an interface to MySql that is similar in concept to the SqlBulkCopy
class / BCP for Sql Server. Basically, it allows you to load data into MySql in bulk. A decent looking example can be found at dragthor.wordpress.com and there's also an example in the MySql documentation.
精彩评论