Command conversion method, system, computer equipment and medium based on JDBC specification
Through the cooperation of the background system and the agent, the external decoding file is processed according to the calling interface and the command object type, which solves the low decoding efficiency problem caused by file modification in the existing technology and realizes efficient database calling and decoding.
Patent Information
- Application Number
- CN202211172072.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-09-26
AI Technical Summary
In the prior art, a large number of modifications are required when an external decoding file is input into a database through a JDBC standard interface, resulting in a decrease in decoding efficiency.
The calling interface is obtained through the background system and its type is determined. The preset proxy is used to create a mirror object for parameter setting and parsing, and a conversion result set is generated, so that the database can be directly called without the need for prior modification of the external decoding file.
Improved the decoding efficiency of external decoding files, avoiding the efficiency drop caused by the increase in the number of modified files.
Smart Images

Figure CN115510137B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to command conversion, and in particular to a command conversion method, system, computer equipment and medium based on JDBC specification. Background Art
[0002] JDBC (Java Database Connectivity) is an interface specification between Java applications and databases. It aims to allow database developers to provide a standard database application programming interface (API) for Java programmers. JDBC defines a universal SQL database API that is cross-database and cross-platform.
[0003] However, in the existing technology, since there are a large number of JDBC standard interfaces currently used in SQL databases, when an external decoding file needs to be input into the server through the JDBC standard interface for database call and execution, the external decoding file needs to be modified in advance, so as to limit the command object of the external decoding file and the calling interface before being called by the database. When there are too many external decoding files that need to be connected, the large amount of external decoding file modification work causes a burden on the staff, which is not conducive to improving decoding efficiency. Summary of the Invention
[0004] Based on this, it is necessary to address the above problems and propose a command conversion method, system, computer equipment and medium based on the JDBC specification that can improve decoding efficiency by automatically selecting the database call interface without modifying the external decoding file.
[0005] The present invention discloses a command conversion method based on the JDBC specification, comprising a protocol server, a JDBC specification interface group, a database, and a backend system, wherein one end of the protocol server is connected to the JDBC specification interface group, the other end of the protocol server is connected to the database, and the backend system is also connected to the JDBC specification interface group and the database. The method comprises:
[0006] The backend system obtains the calling interface called when the external decoding file is input into the protocol server, and determines whether the calling interface is a Connection interface, and the Connection interface is included in the JDBC standard interface group;
[0007] If so, the protocol server determines whether the command object in the external decoding file is a Prepare object;
[0008] If yes, the protocol server creates a mirror Prepare object according to the Prepare object through a preset Connect agent;
[0009] Inputting the image Prepare object into the database, and performing secondary parameter setting on the image Prepare object when the database calls the image Prepare object, thereby generating a first conversion result set;
[0010] The database sends the first conversion result set to the backend system.
[0011] Furthermore, the backend system obtains the calling interface called when the external decoding file is input into the protocol server, and determines whether the calling interface is a Connection interface, and after the step of including the Connection interface in the JDBC standard interface group, further includes:
[0012] If so, the protocol server determines whether the command object in the external decoded file is an SQL object;
[0013] If so, the protocol server creates a mirror SQL object based on the SQL object through a preset Connect agent;
[0014] The protocol server inputs the mirror SQL object into the database for call execution, thereby generating a second conversion result set;
[0015] The database sends the second conversion result set to the backend system.
[0016] Furthermore, after the step of calling the calling interface when the background system obtains the external decoding file input protocol server, it also includes:
[0017] The backend system determines whether the calling interface is a Driver interface, and the Driver interface is included in the JDBC standard interface group;
[0018] If so, the background system determines that the command object contained in the external decoding file input via the Driver interface is a Driver object;
[0019] The database enters the Driver object into a preset registration table for registration, thereby updating the registration information of the database;
[0020] The protocol server creates a mirror Driver object according to the Driver object through a preset Connect agent;
[0021] The protocol server inputs the mirrored Driver object into the updated database for call execution, thereby generating a third conversion result set;
[0022] The database sends the third conversion result set to the backend system.
[0023] Furthermore, after the step of calling the calling interface when the background system obtains the external decoding file input protocol server, it also includes:
[0024] The backend system determines whether the calling interface is a Statement interface, and the Statement interface is included in the JDBC standard interface group;
[0025] If yes, the protocol server parses the Statement contained in the external decoding file to generate a parsed statement set;
[0026] The protocol server determines whether there is a parsing statement in the parsing statement set that matches a preset dangerous statement library;
[0027] If so, the protocol server will intercept the successfully matched parsed statement and send an error message to the background system through the Statement interface.
[0028] Furthermore, after the step of determining whether there is a parsed statement in the parsed statement set that matches a preset dangerous statement library, the protocol server further includes:
[0029] If not, the protocol server inputs the parsed statement set into the database for call execution, thereby generating a preliminary conversion result set;
[0030] The database determines whether the preliminary conversion result set includes a parsing statement that matches a preset error code library;
[0031] If yes, the database will record the successfully parsed statement as a common error code and send the common error code to the backend system;
[0032] If not, the protocol server creates a mirror parsing statement set based on the parsing statement set through a preset Connect agent;
[0033] The protocol server inputs the mirror parsing statement set into the database for call execution, thereby generating a fourth conversion result set;
[0034] The database sends the fourth conversion result set to the backend system.
[0035] Furthermore, the step of the database sending the first conversion result set to the backend system specifically includes:
[0036] The database determines whether a command object in a conversion result set to be processed exists in a buffer, wherein the conversion result set to be processed includes the first conversion result set, the second conversion result set, the third conversion result set, and the fourth conversion result set;
[0037] If so, the to-be-processed conversion result set is sent to the backend system.
[0038] Furthermore, after the step of determining whether the command object in the to-be-processed conversion result set exists in the buffer, the database further includes:
[0039] If not, the database checks again after a preset time period whether the to-be-processed conversion result set exists in the buffer;
[0040] If yes, the to-be-processed conversion result set is sent to the backend system;
[0041] If not, a preset data end status code is obtained and sent to the background system.
[0042] The present invention also discloses a command conversion system based on the JDBC specification, comprising a protocol server, a JDBC specification interface group, a database, and a backend system. One end of the protocol server is connected to the JDBC specification interface group, and the other end of the protocol server is connected to the database. The backend system is also connected to the JDBC specification interface group and the database. The system comprises:
[0043] An acquisition unit, configured to control the backend system to acquire the calling interface called when the external decoding file input protocol server is input, and to determine whether the calling interface is a Connection interface, which is included in the JDBC standard interface group;
[0044] an object determination unit, configured to determine whether, if yes, the protocol server determines whether the command object in the external decoding file is a Prepare object;
[0045] a creating unit, configured to determine that if yes, the protocol server creates a mirror Prepare object according to the Prepare object through a preset Connect agent;
[0046] a calling unit, configured to input the image Prepare object into the database, and perform secondary parameter setting on the image Prepare object when the database calls the image Prepare object, thereby generating a first conversion result set;
[0047] A sending unit is configured to enable the database to send the first conversion result set to the background system.
[0048] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0049] The backend system obtains the calling interface called when the external decoding file is input into the protocol server, and determines whether the calling interface is a Connection interface, and the Connection interface is included in the JDBC standard interface group;
[0050] If so, the protocol server determines whether the command object in the external decoding file is a Prepare object;
[0051] If yes, the protocol server creates a mirror Prepare object according to the Prepare object through a preset Connect agent;
[0052] Inputting the image Prepare object into the database, and performing secondary parameter setting on the image Prepare object when the database calls the image Prepare object, thereby generating a first conversion result set;
[0053] The database sends the first conversion result set to the backend system.
[0054] A computer-readable medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0055] The backend system obtains the calling interface called when the external decoding file is input into the protocol server, and determines whether the calling interface is a Connection interface, and the Connection interface is included in the JDBC standard interface group;
[0056] If so, the protocol server determines whether the command object in the external decoding file is a Prepare object;
[0057] If yes, the protocol server creates a mirror Prepare object according to the Prepare object through a preset Connect agent;
[0058] Inputting the image Prepare object into the database, and performing secondary parameter setting on the image Prepare object when the database calls the image Prepare object, thereby generating a first conversion result set;
[0059] The database sends the first conversion result set to the backend system.
[0060] The above-mentioned command conversion method, system, computer equipment and medium based on the JDBC specification, by classifying the external decoding files according to the type of calling interface and the type of command object and then processing them separately, realizes that the external decoding files can be directly input into the database through the JDBC specification interface for calling and parsing without performing any preliminary operations on the external decoding files. This solves the problem in the prior art that when the external decoding files need to be input into the database through the JDBC specification interface for calling and execution, the external decoding files need to be modified in advance, resulting in an increase in the number of modified files when too many external decoding files are input, resulting in a decrease in decoding efficiency, and improves the decoding efficiency of external decoding files. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0062] in:
[0063] Figure 1 1 is a flowchart of a command conversion method based on the JDBC specification in one embodiment;
[0064] Figure 2 This is a system structure diagram of a command conversion system based on the JDBC specification in one embodiment;
[0065] Figure 3 is a structural block diagram of a computer device in one embodiment;
[0066] Figure 4 This is a schematic diagram of the connections between the protocol server, JDBC standard interface, database, and backend system in one embodiment. DETAILED DESCRIPTION
[0067] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0068] refer to Figure 1 and Figure 4The present invention discloses a command conversion method based on the JDBC specification, including a protocol server 2, a JDBC standard interface group 1, a database 3, and a backend system 4. One end of the protocol server 2 is connected to the JDBC standard interface group 1, and the other end of the protocol server 2 is connected to the database 3. The backend system 4 is also connected to the JDBC standard interface group 1 and the database 4. The method includes:
[0069] S1. The backend system obtains a calling interface called when an external decoding file is input into a protocol server, and determines whether the calling interface is a Connection interface, which is included in the JDBC standard interface group;
[0070] As described in the above step S1, the background system 4 obtains the calling interface called by 3 when the external decoded file is input into the protocol server. It can be understood that the calling interface can be set by the user and is used to input the external decoded file into the protocol server for decoding. After that, the protocol server 3 determines whether the called calling interface is a Connection interface. In addition, the Connection interface is included in the JDBC specification interface group 1.
[0071] In addition, the background system 4 is generally a background server. In addition, the background system 4 can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The present invention does not limit this.
[0072] S2. If yes, the protocol server determines whether the command object in the external decoding file is a Prepare object;
[0073] As described in the above step S2, when the background system 4 determines that the calling interface called when the external decoding file is input into the protocol server 2 is the Connection interface, the protocol server 2 then determines whether the command object in the input external decoding file is a Prepare object, thereby realizing the function of identifying the command object in the external decoding file.
[0074] S3. If yes, the protocol server creates a mirror Prepare object according to the Prepare object through a preset Connect agent;
[0075] As described in the above step S3, when the background system 4 and the protocol server 2 determine that the calling interface of the input external decoding file is the Connection interface, and the command object of the external decoding file is the Prepare object, the protocol server 2 creates the mirror Prepare object according to the external decoding file through the preset Connect agent, and uses the mirror Prepare object to continue the next operation, thereby realizing the function of archiving and backing up the main file (that is, the external decoding file).
[0076] S4. Inputting the image Prepare object into the database, and performing secondary parameter setting on the image Prepare object when the database calls the image Prepare object, thereby generating a first conversion result set;
[0077] As described in step S4 above, the protocol server 2 inputs the image Prepare object into the database 3, and performs secondary parameter settings on the image Prepare object when the database 3 calls the image Prepare object, thereby completing the call processing of the image Prepare object and generating a first conversion result set.
[0078] S5. The database sends the first conversion result set to the backend system.
[0079] As described in step S5 above, the database 3 sends the first conversion result set to the background system 4, thereby completing the function of calling and converting the external decoded file whose calling interface is the Connection interface and whose command object is the Prepare object.
[0080] It can be understood that through the above steps, the background system can perform multi-layer screening on the acquired external decoding files according to the command object type of the external decoding files and the input calling interface, so that the external decoding files that meet the screening conditions are called and converted through the database, and the conversion result set is output to the background system, and the external decoding files that do not meet the screening conditions are automatically processed in other ways, thereby realizing the function of directly inputting the database for calling and execution without prior processing of the external decoding files, thereby outputting the conversion results.
[0081] This embodiment uses the above method to classify external decoding files according to the type of calling interface and the type of command object and then process them separately, so that the external decoding files can be directly input into the database through the JDBC standard interface for calling and parsing without performing any preliminary operations on the external decoding files. This solves the problem in the prior art that when the external decoding files need to be input into the database through the JDBC standard interface for calling and execution, the external decoding files need to be modified in advance, resulting in an increase in the number of modified files when too many external decoding files are input, resulting in a decrease in decoding efficiency, and improves the decoding efficiency of external decoding files.
[0082] In one embodiment, after step S1, the following steps are further included:
[0083] S11. If yes, the protocol server determines whether the command object in the external decoded file is an SQL object. If yes, the protocol server creates a mirror SQL object based on the SQL object through a preset Connect agent. The protocol server inputs the mirror SQL object into the database for call execution, thereby generating a second conversion result set. The database sends the second conversion result set to the backend system.
[0084] As described in the above embodiment, when the background system 4 determines that the calling interface called when the external decoded file is input into the protocol server 2 is the Connection interface, the protocol server 2 determines whether the command object in the input external decoded file is an SQL object. If so, the protocol server 2 creates the mirror SQL object according to the external decoded file through the preset Connect agent, and uses the mirror SQL object to continue the next operation, thereby realizing the function of archiving and backing up the main file (i.e., the external decoded file). After that, the protocol server 2 inputs the mirror SQL object into the database 3 for calling and execution, thereby generating a second conversion result set. Finally, the database 3 sends the second conversion result set to the background system 4, thereby completing the function of calling and converting the external decoded file whose calling interface is the Connection interface and the command object is the SQL object.
[0085] In one embodiment, after the step of obtaining the calling interface called when the background system inputs the external decoding file into the protocol server, the step further includes:
[0086] S12. The backend system determines whether the calling interface is a Driver interface, and the Driver interface is included in the JDBC standard interface group. If so, the backend system determines that the command object contained in the external decoding file input through the Driver interface is a Driver object, and the database inputs the Driver object into a preset registry for registration, thereby updating the registration information of the database. The protocol server creates a mirror Driver object based on the Driver object through a preset Connect agent, and the protocol server inputs the mirror Driver object into the updated database for call execution, thereby generating a third conversion result set, and the database sends the third conversion result set to the backend system.
[0087] As described in the above embodiment, when the background system 4 obtains the external decoded file input protocol server 3, the calling interface is called. It can be understood that the calling interface can be set by the user and is used to input the external decoded file into the protocol server for decoding. After that, the protocol server 3 determines whether the called calling interface is a Driver interface. In addition, the Driver interface is included in the JDBC standard interface group 1;
[0088] Then, when the background system 4 determines that the calling interface is the Driver interface, that is, the background system 4 also determines that the command object contained in the external decoding file input through the Driver interface is the Driver object, and then the database 3 enters the Driver object into the preset registry for registration. It can be understood that the preset registry is pre-set by the user in the database 3 and is used to update the parameters of the database 3. Then, when the database 3 enters the Driver object into the preset registry for registration, the database 3 is updated according to the re-registered preset registry, thereby completing the database 3's call setting for the Driver object. Then, the protocol server 2 enters the mirrored Driver object into the updated database 3 for call execution, thereby generating a third conversion result set. Finally, the database 3 sends the third conversion result set to the background system, thereby completing the function of calling and converting the external decoding file whose calling interface is the Driver interface and the command object is the Driver object.
[0089] In one embodiment, after step S1, the following steps are further included:
[0090] S13. The backend system determines whether the calling interface is a Statement interface, and the Statement interface is included in the JDBC standard interface group. If so, the protocol server parses the Statement statement contained in the external decoding file to generate a parsing statement set. The protocol server determines whether there is a parsing statement in the parsing statement set that matches a preset dangerous statement library. If so, the protocol server intercepts the successfully matched parsing statement and sends an error message to the backend system through the Statement interface.
[0091] As described in the above embodiment, when the background system 4 obtains the external decoded file input protocol server 3, the calling interface is called. It can be understood that the calling interface can be set by the user and is used to input the external decoded file into the protocol server for decoding. After that, the protocol server 3 determines whether the called calling interface is a Statement interface. In addition, the Statement interface is included in the JDBC standard interface group 1;
[0092] When the background system 4 determines that the calling interface is the Statement interface, that is, the background system 4 also determines that the command object contained in the external decoding file input through the Statement interface is a Statement object, then the protocol server 2 parses the Statement statement contained in the external decoding file to generate a parsing statement set. At this time, the protocol server 2 determines whether there is a parsing statement in the parsing statement set that matches the preset dangerous statement library. It can be understood that the preset dangerous statement library contains multiple dangerous statements that will cause the database 3 to call the conversion process failure. When the parsing statement contained in the parsing statement set matches the dangerous statement in the preset dangerous statement library, the protocol server 2 will intercept the successfully matched parsing statement record and send an error message to the background system 4 through the Statement interface, thereby preventing the database 3 from calling the conversion process failure.
[0093] In one embodiment, after the step of determining whether there is a parsed statement in the parsed statement set that matches a preset dangerous statement library, the protocol server further includes:
[0094] S15. If not, the protocol server inputs the parsing statement set into the database for call execution, thereby generating a preliminary conversion result set. The database determines whether the preliminary conversion result set contains a parsing statement that matches a preset error code library. If so, the database records the successfully matched parsed statement as a common error code and sends the common error code to the backend system. If not, the protocol server creates a mirror parsing statement set based on the parsing statement set through a preset Connect agent. The protocol server inputs the mirror parsing statement set into the database for call execution, thereby generating a fourth conversion result set. The database sends the fourth conversion result set to the backend system.
[0095] As described in the above embodiment, when the protocol server 2 determines that there is no parsed statement matching the preset dangerous statement library in the parsed statement set, the protocol server 2 inputs the parsed statement set into the database 3 for call execution, thereby generating a preliminary conversion result set. Thereafter, the protocol server 2 again determines whether there is a parsed statement matching the preset dangerous statement library in the preliminary conversion result set. If so, the protocol server 2 determines that the preliminary conversion result set contains a dangerous statement that will cause the database 3 to call the conversion process failure. At this time, the protocol server 2 records the successfully matched parsed statement as a common error code and sends the common error code to the background system 4, thereby preventing the common error code from being called by the database 3.
[0096] In addition, when the protocol server 2 determines that there is no parsing statement matching the preset dangerous statement library in the preliminary conversion result set, it creates a mirror parsing statement set based on the parsing statement set through the preset Connect agent, and then inputs the mirror parsing statement set into the database 4 for calling and execution, thereby generating a fourth conversion result set; thereby completing the function of calling and converting the external decoding file whose calling interface is the Statement interface, the command object is the Statement object, and the internal parsing statement does not contain error statements and error codes.
[0097] In one embodiment, step S5 specifically includes:
[0098] S51. The database determines whether a command object in a pending conversion result set exists in a buffer, where the processing conversion result set includes the first conversion result set, the second conversion result set, the third conversion result set, and the fourth conversion result set. If so, the pending conversion result set is sent to the background system.
[0099] As described in the above embodiment, when the database 3 determines whether the command object in the conversion result set to be processed is in the buffer of the database 3, if so, the database 3 sends the conversion result set to be processed to the background system 4, thereby completing the call conversion process of the external decoded file;
[0100] It can be understood that the processed conversion result set includes the first conversion result set, the second conversion result set, the third conversion result set and the fourth conversion result set, thereby realizing the function of sending all conversion results converted and output by the database 3 in the technical solution of the present invention to the background system 4.
[0101] In one embodiment, after the step of determining whether the command object in the to-be-processed conversion result set exists in the buffer, the database further includes:
[0102] S52. If not, the database checks again after a preset time period whether the pending conversion result set exists in the buffer. If so, the pending conversion result set is sent to the background system. If not, a preset data end status code is obtained and sent to the background system.
[0103] As described in the above embodiment, when the database 3 determines that the command object in the pending conversion result set is not in the buffer of the database 3, the database 3 checks again after a preset time period whether the pending conversion result set exists in the buffer, thereby realizing the function of obtaining and judging whether the command objects in the next batch of pending conversion result sets obtained are in the buffer of the database 3. If so, the database 3 sends the next batch of pending conversion result sets obtained to the background system 4, thereby realizing the continuous call conversion of multiple external decoded files;
[0104] In addition, when the to-be-processed conversion result set still does not exist in the buffer after the preset time period, the database 3 determines that the call conversion process for the external decoding file has ended, and then obtains the preset data end status code and sends it to the background system 4, thereby ending the call conversion process for the external decoding file.
[0105] refer to Figure 2 The present invention also discloses a command conversion system based on the JDBC specification, including a protocol server 2, a JDBC specification interface group 1, a database 3, and a backend system 4. One end of the protocol server 2 is connected to the JDBC specification interface group 1, and the other end of the protocol server 2 is connected to the database 3. The backend system 4 is also connected to the JDBC specification interface group 1 and the database 3. The system includes:
[0106] The acquisition unit 10 is used to control the backend system to acquire the calling interface called when the external decoding file input protocol server is called, and to determine whether the calling interface is a Connection interface, and the Connection interface is included in the JDBC standard interface group;
[0107] The object determination unit 20 is configured to determine whether, if yes, the protocol server determines whether the command object in the external decoding file is a Prepare object;
[0108] A creating unit 30 is configured to determine that if yes, the protocol server creates a mirror Prepare object according to the Prepare object through a preset Connect agent;
[0109] A calling unit 40 is configured to input the image Prepare object into the database and perform secondary parameter setting on the image Prepare object when the database calls the image Prepare object, thereby generating a first conversion result set;
[0110] The sending unit 50 is configured to enable the database to send the first conversion result set to the backend system.
[0111] The above-mentioned units are for executing the command conversion system based on the JDBC specification, and will not be introduced one by one here.
[0112] Figure 3 FIG1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a server, including but not limited to a high-performance computer and a high-performance computer cluster. Figure 3 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When executed by the processor, the computer program enables the processor to implement the employee status determination method. The internal memory may also store a computer program. When executed by the processor, the computer program enables the processor to execute the command conversion method based on the JDBC specification.
[0113] In one embodiment, the customer behavior identification method provided by the present invention can be implemented in the form of a computer program. The computer program can be used in Figure 3 The computer device is shown as running. The memory of the computer device can store various program templates that constitute the automatic mail classification and aggregation device, such as: an acquisition unit 10, an object judgment unit 20, a creation unit 30, a calling unit 40, and a sending unit 50.
[0114] A computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0115] The backend system determines whether the command type contained in the MYSQL protocol package input by the ODBC standard interface is a query command. If so, the protocol server parses the statements contained in the MYSQL protocol package to generate a parsed statement set. The protocol server determines whether the parsed statements contained in the parsed statement set are MYSQL statements. If so, the protocol server converts the MYSQL statements into an interface conversion parameter set for the JDBC standard interface group in the database to call and execute, thereby converting it into a conversion result set. The database sends the conversion result set to the backend system.
[0116] From the above embodiments, it can be seen that the greatest beneficial effect of the present invention is that the background system obtains the calling interface called when the external decoded file is input into the protocol server, and determines whether the calling interface is a Connection interface, and the Connection interface is included in the JDBC specification interface group. If so, the protocol server determines whether the command object in the external decoded file is a Prepare object. If so, the protocol server creates a mirror Prepare object according to the Prepare object through the preset Connect agent, inputs the mirror Prepare object into the database, and performs secondary parameter setting on the mirror Prepare object when the database calls the mirror Prepare object, thereby generating a first conversion result set, and the database sends the first conversion result set to the background system.
[0117] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), and double data rate.
[0118] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A command conversion method based on JDBC specification, characterized in that: The method comprises a protocol server, a JDBC standard interface group, a database, and a backend system, wherein one end of the protocol server is connected to the JDBC standard interface group, the other end of the protocol server is connected to the database, and the backend system is also connected to the JDBC standard interface group and the database. The method comprises: The backend system obtains the calling interface called when the external decoding file is input into the protocol server, and determines whether the calling interface is a Connection interface, and the Connection interface is included in the JDBC standard interface group; If so, the protocol server determines whether the command object in the external decoding file is a Prepare object; If yes, the protocol server creates a mirror Prepare object according to the Prepare object through a preset Connect agent; Inputting the image Prepare object into the database, and performing secondary parameter setting on the image Prepare object when the database calls the image Prepare object, thereby generating a first conversion result set; The database sends the first conversion result set to the backend system.
2. The command conversion method based on the JDBC specification according to claim 1, characterized in that: The backend system obtains a calling interface called when an external decoding file is input into a protocol server, and determines whether the calling interface is a Connection interface, and after the step of including the Connection interface in the JDBC standard interface group, further includes: If so, the protocol server determines whether the command object in the external decoded file is an SQL object; If so, the protocol server creates a mirror SQL object based on the SQL object through a preset Connect agent; The protocol server inputs the mirror SQL object into the database for call execution, thereby generating a second conversion result set; The database sends the second conversion result set to the backend system.
3. The command conversion method based on the JDBC specification according to claim 2, characterized in that: After the step of calling the calling interface when the background system obtains the external decoding file input protocol server, it also includes: The backend system determines whether the calling interface is a Driver interface, and the Driver interface is included in the JDBC standard interface group; If so, the background system determines that the command object contained in the external decoding file input via the Driver interface is a Driver object; The database enters the Driver object into a preset registration table for registration, thereby updating the registration information of the database; The protocol server creates a mirror Driver object according to the Driver object through a preset Connect agent; The protocol server inputs the mirrored Driver object into the updated database for call execution, thereby generating a third conversion result set; The database sends the third conversion result set to the backend system.
4. The command conversion method based on the JDBC specification according to claim 3, characterized in that: After the step of calling the calling interface when the background system obtains the external decoding file input protocol server, it also includes: The backend system determines whether the calling interface is a Statement interface, and the Statement interface is included in the JDBC standard interface group; If yes, the protocol server parses the Statement contained in the external decoding file to generate a parsed statement set; The protocol server determines whether there is a parsing statement in the parsing statement set that matches a preset dangerous statement library; If so, the protocol server will intercept the successfully matched parsed statement and send an error message to the background system through the Statement interface.
5. The command conversion method based on the JDBC specification according to claim 4, characterized in that: After the step of the protocol server determining whether there is a parsed statement in the parsed statement set that matches a preset dangerous statement library, the method further includes: If not, the protocol server inputs the parsed statement set into the database for call execution, thereby generating a preliminary conversion result set; The database determines whether the preliminary conversion result set includes a parsing statement that matches a preset error code library; If yes, the database will record the successfully parsed statement as a common error code and send the common error code to the backend system; If not, the protocol server creates a mirror parsing statement set based on the parsing statement set through a preset Connect agent; The protocol server inputs the mirror parsing statement set into the database for call execution, thereby generating a fourth conversion result set; The database sends the fourth conversion result set to the backend system.
6. The command conversion method based on the JDBC specification according to claim 5, characterized in that: The step of the database sending the first conversion result set to the backend system specifically includes: The database determines whether a command object in a conversion result set to be processed exists in a buffer, wherein the conversion result set to be processed includes the first conversion result set, the second conversion result set, the third conversion result set, and the fourth conversion result set; If so, the to-be-processed conversion result set is sent to the backend system.
7. The command conversion method based on the JDBC specification according to claim 6, characterized in that: After the step of the database determining whether the command object in the to-be-processed conversion result set exists in the buffer, the method further includes: If not, the database checks again after a preset time period whether the to-be-processed conversion result set exists in the buffer; If yes, the to-be-processed conversion result set is sent to the backend system; If not, a preset data end status code is obtained and sent to the background system.
8. A command conversion system based on ODBC specification, characterized in that: The system comprises a protocol server, a JDBC standard interface group, a database, and a backend system. One end of the protocol server is connected to the JDBC standard interface group, and the other end of the protocol server is connected to the database. The backend system is also connected to the JDBC standard interface group and the database. The system comprises: An acquisition unit, configured to control the backend system to acquire the calling interface called when the external decoding file input protocol server is input, and to determine whether the calling interface is a Connection interface, which is included in the JDBC standard interface group; an object determination unit, configured to determine whether, if yes, the protocol server determines whether the command object in the external decoding file is a Prepare object; a creating unit, configured to determine that if yes, the protocol server creates a mirror Prepare object according to the Prepare object through a preset Connect agent; a calling unit, configured to input the image Prepare object into the database, and perform secondary parameter setting on the image Prepare object when the database calls the image Prepare object, thereby generating a first conversion result set; A sending unit is configured to enable the database to send the first conversion result set to the background system.
9. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the command conversion method based on the JDBC specification as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the command conversion method based on the JDBC specification as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for accessing flat file by using java database connectivity (JDBC) interface
CN102521408A
Method and apparatus for data access to heterogeneous data sources
WO2000075849A2