Data importing method and device and server
A technology of data import and data business, applied in the database field, can solve the problems of no effective solution proposed, low processing efficiency of parsing and storing in the database, etc., and achieve the effect of improving the overall processing efficiency and reducing the time
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0029] The embodiment of the present invention provides a data import method, see figure 1 A schematic flow diagram of a data import method is shown, and the method flow shown in this embodiment includes the following steps:
[0030] Step S11, using Apache POI technology to parse the excel file to obtain the data to be imported into the Mysql database.
[0031] Among them, Apache POI is an open source function library of the Apache Software Foundation. POI provides APIs for Java programs to read and write files in Microsoft Office format. In this embodiment, Apache POI technology is used to parse the excel file, and the data in the excel file is imported into the Mysql database. The above excel file may be a file uploaded by the user to the server, or a file pre-saved in the server. Compared with Jxl, POI is more efficient in parsing excel files, especially when parsing large excel files, using POI technology can improve efficiency and is compatible with excel files with suf...
Embodiment 2
[0053] The embodiment of the present invention provides a data import method, taking the data in the excel file having business constraints with other data as an example, see figure 2 A schematic flow diagram of a data import method is shown, and the method flow shown in this embodiment includes the following steps:
[0054] Step S21, uploading the excel file containing the data to be imported to the server.
[0055] In this embodiment, the Mysql database that needs to be imported is described on the server as an example, and it may also be stored in other locations. When the Mysql database is on the server, first upload the excel file to be imported.
[0056] Step S22, using Apache POI technology to parse the excel file to obtain the data to be imported into the Mysql database.
[0057] After parsing the data that needs to be imported, load the data into the content of the system.
[0058] Step S23, judging whether business processing needs to be performed based on data i...
Embodiment 3
[0067] The embodiment of the present invention provides a data import method, taking the data in an excel file as an example with a unique constraint, see image 3 A schematic flow diagram of a data import method is shown, and the method flow shown in this embodiment includes the following steps:
[0068] Step S31, uploading the excel file containing the data to be imported to the server.
[0069] Step S32, using Apache POI technology to parse the excel file to obtain the data to be imported into the Mysql database.
[0070] Step S33, judging whether there is a unique constraint according to the acquired import mode. If yes, execute step S34; if no, execute step S37.
[0071] Specifically, it is necessary to judge whether the uniqueness of the data needs to be guaranteed to avoid repeated import.
[0072] Step S34, data processing is performed through ON DUPLICATE KEY UPDATE syntax in Mysql.
[0073] Step S35, judging whether stored procedures are used for data processing....
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


