CN112035565A - Method for generating sql script according to word document - Google Patents
Method for generating sql script according to word document Download PDFInfo
- Publication number
- CN112035565A CN112035565A CN202010913354.0A CN202010913354A CN112035565A CN 112035565 A CN112035565 A CN 112035565A CN 202010913354 A CN202010913354 A CN 202010913354A CN 112035565 A CN112035565 A CN 112035565A
- Authority
- CN
- China
- Prior art keywords
- word document
- sql script
- specified format
- java
- word
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
Abstract
The invention discloses a method for generating an sql script according to a word document, which relates to the technical field of data arrangement; writing a database word document with a specified format, specifying a Java application program to read word document information data, converting the read word document information data into executable SQL script statements by using Java, and generating an executable SQL script file; the design efficiency of database designers is improved, and the document output rate is improved; the database development efficiency of database developers is improved, and the software development efficiency is improved; and a uniform format of the database file is achieved.
Description
Technical Field
The invention discloses a method, relates to the technical field of data arrangement, and particularly relates to a method for generating an sql script according to a word document.
Background
Databases (databases) are warehouses that organize, store, and manage data according to data structures that have since sixty years ago, with the development of information technology and markets, particularly after the nineties of the twentieth century, data management has no longer been the only way to store and manage data, and has turned into the various ways of data management that users need.
With the continuous development of a software engineering mode, the database design becomes one of important processes of software development, and the database design supplements with demand analysis and overall design to form an overall design link of the software development. However, with the design and the division of labor of the developers, the developers cannot rapidly create and develop the database after taking the design documents of the designers, so that the software development efficiency is reduced, and even the actual database is inconsistent with the design.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method for generating an SQL script according to a word document, which can generate a word document in a specified format, is convenient for designers to write and can improve the efficiency of database development by utilizing the method for generating an executable SQL script file by the word document in the format.
The specific scheme provided by the invention is as follows:
writing a database word document with a specified format, specifying a Java application program to read word document information data, converting the read word document information data into executable SQL script statements by utilizing Java, and generating an executable SQL script file.
In the method for generating the sql script according to the word document, whether the database word document has a specified format or not is judged, if yes, the database word document with the specified format is written according to the specified format, and if not, an initialization word document with the specified format is generated.
In the method for generating the sql script according to the word document, a CreateTable class main method is utilized, and the word initialization document with the specified format is generated by inputting the generated word file name and path with the specified format.
In the method for generating the sql script according to the word document, the Java POI is used for reading the word document information data,
converting the read word document information data into sql statements through Java IO,
and writing the sql into a specified file through Java IO to generate an executable sql script file.
A system for generating sql script according to word document comprises a writing module, a reading module and a converting module,
the writing module writes a database word document in a specified format, the reading module specifies a Java application program to read word document information data, the converting module converts the read word document information data into executable SQL script statements by using Java and generates an executable SQL script file.
The writing module in the system for generating the sql script according to the word document judges whether the database word document has a specified format, if so, the database word document with the specified format is written according to the specified format, and if not, an initialization word document with the specified format is generated.
The writing module in the system for generating the sql script according to the word document generates a word initialization document with a specified format by inputting a generated word file name and path with the specified format by using a CreateTable class mail method.
In the system for generating the sql script according to the word document, the reading module reads the word document information data by using the Java POI,
and the conversion module converts the read word document information data into an sql statement through Java IO, and writes the sql into a specified file through Java IO to generate an executable sql script file.
An apparatus for generating sql scripts from word documents, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
and the at least one processor is used for calling the machine-readable program and executing the method for generating the sql script according to the word document.
The invention has the advantages that:
the invention provides a method for generating SQL script according to word document, which is characterized in that a database word document with a specified format is compiled, a Java application program is specified to read word document information data, the read word document information data is converted into executable SQL script statements by using Java, and an executable SQL script file is generated; the design efficiency of database designers is improved, and the document output rate is improved; the database development efficiency of database developers is improved, and the software development efficiency is improved; and a uniform format of the database file is achieved.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention.
Detailed Description
Java is a door-to-object-oriented programming language, which is a representative of the static object-oriented programming language, and excellently implements object-oriented theory, allowing programmers to perform complicated programming in an elegant thinking manner. Java has the characteristics of simplicity, object-oriented property, distribution, robustness, safety, platform independence and portability, multithreading, dynamicity and the like. Java may write desktop applications, Web applications, distributed system and embedded system applications, etc.
The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it, but the examples are not intended to limit the present invention.
The invention provides a method for generating an SQL script according to a word document, which comprises the steps of compiling a database word document in a specified format, specifying a Java application program to read word document information data, converting the read word document information data into executable SQL script statements by utilizing Java, and generating an executable SQL script file.
The method for generating the word document in the specified format is convenient for designers to write and can be used for generating the executable SQL script file to improve the efficiency of database development.
In some embodiments of the present invention, it is determined whether a database word document has a specified format, if so, the database word document with the specified format is written according to the specified format, otherwise, an initialization word document with the specified format is generated, wherein a CreateTable class main method is used to generate a word initialization document with the specified format by inputting a generated word document name and path with the specified format. For example, the JavaPOI technology is mainly used, xwpf is used for generating a document with a word table in a specified format, and the table in the document is shown in a table 1.
TABLE 1
And simultaneously, inputting an executable sql script file path needing to be generated, a table name of a table needing to be generated and a path of a word document with a specified format by using a method for running ExportSql class main, and generating the executable sql script file in the specified path. The method mainly comprises the steps of reading information data in doc and docx documents by using a JavaPOI technology, converting the read information into sql sentences by using Java IO and related logic codes, and writing the sql into a specified file by using the Java IO.
The invention also provides a system for generating the sql script according to the word document, which comprises a compiling module, a reading module and a converting module,
the writing module writes a database word document in a specified format, the reading module specifies a Java application program to read word document information data, the converting module converts the read word document information data into executable SQL script statements by using Java and generates an executable SQL script file.
The information interaction, execution process and other contents between the modules in the system are based on the same concept as the method embodiment of the present invention, and specific contents can be referred to the description in the method embodiment of the present invention, and are not described herein again.
Meanwhile, the invention provides a device for generating sql script according to word document, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
and the at least one processor is used for calling the machine-readable program and executing the method for generating the sql script according to the word document.
The processor in the device performs information interaction, executes readable program process, and the like, and the specific content can be referred to the description in the embodiment of the method of the present invention because the processor is based on the same concept as the embodiment of the method of the present invention, and is not described herein again.
It should be noted that not all steps and modules in the above flows and system structures are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or some components in a plurality of independent devices may be implemented together.
The above-mentioned embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitution or change made by the technical personnel in the technical field on the basis of the invention is all within the protection scope of the invention. The protection scope of the invention is subject to the claims.
Claims (9)
1. A method for generating SQL script according to word document is characterized in that a database word document with a specified format is compiled, a Java application program is specified to read word document information data, the read word document information data is converted into executable SQL script statements by using Java, and an executable SQL script file is generated.
2. The method for generating sql script according to the word document as claimed in claim 1, wherein it is determined whether the database word document has a specified format, if yes, the database word document of the specified format is written according to the specified format, otherwise, the initialized word document of the specified format is generated.
3. The method of claim 2, wherein the method of creating sql script from word document is to create a word initialization document with a specified format by inputting the name and path of the created word document with the specified format using CreateTable class mail method.
4. A method of generating sql scripts based on word documents according to any of claims 1-3, characterized in that the word document information data is read using Java POIs,
converting the read word document information data into sql statements through Java IO,
and writing the sql into a specified file through Java IO to generate an executable sql script file.
5. A system for generating sql script according to word document is characterized in that the system comprises a compiling module, a reading module and a converting module,
the writing module writes a database word document in a specified format, the reading module specifies a Java application program to read word document information data, the converting module converts the read word document information data into executable SQL script statements by using Java and generates an executable SQL script file.
6. The system for generating sql script according to the word document as claimed in claim 5, wherein the writing module determines whether the database word document has a specified format, if yes, writes the database word document in the specified format according to the specified format, otherwise generates the initialized word document in the specified format.
7. The system of claim 6, wherein the authoring module generates the word initialization document in the specified format by inputting the generated word file name and path in the specified format using a CreateTable class main method.
8. A system for generating sql script based on word documents according to any of the claims 5-7, characterized in that the reading module reads the word document information data using Java POI,
and the conversion module converts the read word document information data into an sql statement through Java IO, and writes the sql into a specified file through Java IO to generate an executable sql script file.
9. An apparatus for generating sql script according to word document, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine readable program to execute a method of any one of claims 1 to 4 for generating an sql script from a word document.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010913354.0A CN112035565A (en) | 2020-09-03 | 2020-09-03 | Method for generating sql script according to word document |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010913354.0A CN112035565A (en) | 2020-09-03 | 2020-09-03 | Method for generating sql script according to word document |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112035565A true CN112035565A (en) | 2020-12-04 |
Family
ID=73591710
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010913354.0A Pending CN112035565A (en) | 2020-09-03 | 2020-09-03 | Method for generating sql script according to word document |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112035565A (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103135976A (en) * | 2011-11-30 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Code automatic generation method and device |
CN104657340A (en) * | 2015-02-10 | 2015-05-27 | 上海创景计算机系统有限公司 | Expandable script-based Word report generating system and method |
CN105278961A (en) * | 2015-10-28 | 2016-01-27 | 广州华多网络科技有限公司 | Method and system for generating database table structure document |
CN108170422A (en) * | 2017-12-28 | 2018-06-15 | 国网浙江省电力有限公司电力科学研究院 | A kind of report form generation method and system based on Word annotations |
CN108885612A (en) * | 2016-04-12 | 2018-11-23 | 西门子股份公司 | For handling the device and method through binary-coded structured documents |
CN109684326A (en) * | 2018-11-13 | 2019-04-26 | 平安科技(深圳)有限公司 | Tables of data creation method, device, equipment and computer readable storage medium |
CN109933571A (en) * | 2019-01-23 | 2019-06-25 | 平安科技(深圳)有限公司 | Database design documentation generation method, device and computer readable storage medium |
CN110780860A (en) * | 2019-09-10 | 2020-02-11 | 中国平安财产保险股份有限公司 | Generation method and device of table building script, computer equipment and storage medium |
CN111241800A (en) * | 2020-01-17 | 2020-06-05 | 深圳震有科技股份有限公司 | MySQL database table structure document generation method, storage medium and intelligent terminal |
CN111352986A (en) * | 2020-02-28 | 2020-06-30 | 平安科技(深圳)有限公司 | Method and device for exporting database table structure and terminal equipment |
-
2020
- 2020-09-03 CN CN202010913354.0A patent/CN112035565A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103135976A (en) * | 2011-11-30 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Code automatic generation method and device |
CN104657340A (en) * | 2015-02-10 | 2015-05-27 | 上海创景计算机系统有限公司 | Expandable script-based Word report generating system and method |
CN105278961A (en) * | 2015-10-28 | 2016-01-27 | 广州华多网络科技有限公司 | Method and system for generating database table structure document |
CN108885612A (en) * | 2016-04-12 | 2018-11-23 | 西门子股份公司 | For handling the device and method through binary-coded structured documents |
CN108170422A (en) * | 2017-12-28 | 2018-06-15 | 国网浙江省电力有限公司电力科学研究院 | A kind of report form generation method and system based on Word annotations |
CN109684326A (en) * | 2018-11-13 | 2019-04-26 | 平安科技(深圳)有限公司 | Tables of data creation method, device, equipment and computer readable storage medium |
CN109933571A (en) * | 2019-01-23 | 2019-06-25 | 平安科技(深圳)有限公司 | Database design documentation generation method, device and computer readable storage medium |
CN110780860A (en) * | 2019-09-10 | 2020-02-11 | 中国平安财产保险股份有限公司 | Generation method and device of table building script, computer equipment and storage medium |
CN111241800A (en) * | 2020-01-17 | 2020-06-05 | 深圳震有科技股份有限公司 | MySQL database table structure document generation method, storage medium and intelligent terminal |
CN111352986A (en) * | 2020-02-28 | 2020-06-30 | 平安科技(深圳)有限公司 | Method and device for exporting database table structure and terminal equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Schulte et al. | A multi-language computing environment for literate programming and reproducible research | |
US8484626B2 (en) | Generic XML screen scraping | |
CN101339500B (en) | Data binding application program interface creation method based on XML mode | |
US20060031820A1 (en) | Method for program transformation and apparatus for COBOL to Java program transformation | |
US6594823B1 (en) | Method and system for representing a high-level programming language data structure in a mark-up language | |
CN107861728B (en) | Method and system for converting traditional program language into modern program language | |
US20040015840A1 (en) | Mechanism for converting between JAVA classes and XML | |
CN102929682B (en) | The preprocess method of automatic expansion TCL language and device | |
Chillón et al. | A model-driven approach to generate schemas for object-document mappers | |
US8117610B2 (en) | System and method for integrated artifact management | |
US20130132927A1 (en) | Business content authoring and distribution | |
TWI327701B (en) | System and method for defining and using subclasses declaratively within markup | |
Berz et al. | COSY INFINITY version 8.1 programming manual | |
CN113138755A (en) | JSON serialization and deserialization optimization method and system | |
CN112035565A (en) | Method for generating sql script according to word document | |
Křikava et al. | SIGMA: Scala internal domain-specific languages for model manipulations | |
JP6982920B1 (en) | Source code converter and program | |
US9697021B2 (en) | Modifiable high-level intermediate representation of source code | |
Collard et al. | Document-oriented source code transformation using XML | |
Neeraj et al. | A domain specific language for business transaction processing | |
Komatsu et al. | Xevolver: A code transformation framework for separation of system‐awareness from application codes | |
US20080313620A1 (en) | System and method for saving and restoring a self-describing data structure in various formats | |
Gapeyev et al. | Statically typed document transformation: An Xtatic experience | |
US7917893B2 (en) | Using a system of annotations to generate views and adapters | |
O’Hara | Improving programming language transformation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |