Invention content
In view of the above problems, it is proposed that the present invention overcoming the above problem in order to provide one kind or solves at least partly
The execution method and device for stating the special sentence of problem, using intermediate part, it is special that database can be executed correctly
The matching instruction of instruction.
According to the first aspect of the invention, a kind of execution method of special instruction is proposed, applied to being coupled in database
Middleware between client, the method includes:
Special instruction is sent, and records relevant information corresponding with the special instruction, wherein the relevant information packet
It includes:Send the template instruction that the special instruction uses the mark of connection and/or the special instruction to include;
Receive the matching instruction of the special instruction;
It will be described using preset sending method corresponding with the relevant information according to the relevant information of record
Matching instruction is sent to database execution.
Optionally, when the relevant information uses the mark of connection by the transmission special instruction, use is preset
The matching instruction is sent to database and executed, specifically included by sending method corresponding with the relevant information:
By the matching instruction by with send special instruction institute and be sent to using corresponding connect of the mark of connection
Database executes.
Optionally, after sending special instruction, the method further includes:
It keeps sending used in the special instruction for the database and the client and connect.
Optionally, when the relevant information be the special instruction include template instruction when, using it is preset with it is described
The matching instruction is sent to database and executed, specifically included by the corresponding sending method of relevant information:
General instruction is generated according to template instruction and the matching instruction;
The general instruction of generation is sent to database to execute.
Optionally, general instruction is generated according to template instruction and the matching instruction, specifically included:
Judge in the template instruction whether to include undetermined parameter;
If so, being the undetermined parameter assignment in the matching instruction according to the parameter value for including, by the mould after assignment
Plate instruction is as the general instruction generated;
Otherwise, the template is instructed as the general instruction generated.
Optionally, described instruction includes:The instruction of structured query language SQL statement form;
When the relevant information uses the mark of connection by the transmission special instruction, the special instruction includes
BEGIN statement or PREPARE sentences, when the special instruction is BEGIN statement, the matching instruction is and the BEGIN
Sentence belongs to the sentence of the same db transaction, and when the special instruction is PREPARE sentences, the matching instruction is
EXECUTE sentences or DEALLOCATE sentences;
When the relevant information is the template instruction that the special instruction includes, the special instruction includes PREPARE
Sentence, the matching instruction include EXECUTE sentences.
According to the second aspect of the invention, it proposes a kind of executive device of special instruction, is coupled to database and client
Between end, including:
First sending module for sending special instruction, and records relevant information corresponding with the special instruction,
In, the relevant information includes:Send the special instruction use connection mark and/or the special instruction include
Template instructs;
Receiving module, the matching instruction for receiving the special instruction;
Second sending module, for the relevant information that record according to first sending module, using preset and
The matching instruction is sent to database and executed by the corresponding sending method of the relevant information.
When the relevant information uses the mark of connection by the transmission special instruction, the second sending module tool
Body is used for, by the matching instruction by with send special instruction institute and be sent to number using corresponding connect of the mark of connection
It is executed according to library.
Optionally, described device further includes:
Module is kept, is the database and the visitor after sending special instruction in first sending module
Family end keeps first sending module to send connection used in the special instruction.
When the relevant information is the template instruction that the special instruction includes, second sending module is specifically used
In generating general instruction according to template instruction and the matching instruction, general instruct of generation be sent to database
It executes.
Second sending module is specifically used for, and judges whether in the template instruction include undetermined parameter, if so, root
It is the undetermined parameter assignment in the matching instruction according to the parameter value for including, by the template instruction after assignment as one generated
As instruct, otherwise, by the template instruction as generation general instruction.
Optionally, described instruction includes:The instruction of structured query language SQL statement form;
When the relevant information uses the mark of connection by the transmission special instruction, the special instruction includes
BEGIN statement or PREPARE sentences, when the special instruction is BEGIN statement, the matching instruction is and the BEGIN
Sentence belongs to the sentence of the same db transaction, and when the special instruction is PREPARE sentences, the matching instruction is
EXECUTE sentences or DEALLOCATE sentences;
When the relevant information is the template instruction that the special instruction includes, the special instruction includes PREPARE
Sentence, the matching instruction include EXECUTE sentences.
According to the execution method of special instruction provided by the invention, middleware sends special instruction, and record is special with this
Corresponding relevant information is instructed, when receiving the matching instruction of the special instruction, using preset corresponding with the relevant information
Sending method, by the matching instruction be sent to database execute, due to database can correctly identify using it is preset with should
The matching instruction that the corresponding sending method of relevant information is sent, therefore, database can also correctly execute the matching instruction, solution
The problem of database of having determined can not correctly execute the matching instruction.
Specific implementation mode
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
Below in conjunction with attached drawing, the technical solution that each embodiment of the application provides is described in detail.
Fig. 1 is the schematic diagram of the execution method of the special instruction of embodiment according to the present invention, can be applied to be coupled in number
According to the middleware between library and client, the method may include steps:
S101:Special instruction is sent, and records relevant information corresponding with the special instruction.
Wherein, which includes:Send mark and/or the special instruction packet that the special instruction uses connection
The template instruction contained.
S102:Receive the matching instruction of the special instruction.
S103:According to the relevant information of record, using preset sending method corresponding with the relevant information, by this
Matching instruction is sent to database execution.
From the foregoing, according to the embodiment, middleware sends special instruction, and records phase corresponding with the special instruction
Close information, that is, middleware often sends a special instruction, can all record relevant information corresponding with the special instruction, the correlation
Information is used to determine the sending method of the matching instruction of the special instruction, therefore, for different types of special instruction, record
Relevant information is also different, and for certain a kind of special instruction, the relevant information of record uses connection by the transmission special instruction
Mark, for another kind of special instruction, the relevant information of record is the template instruction that the special instruction includes.Subsequently work as middleware
When receiving the matching instruction of the special instruction, then according to the relevant information of record, using preset corresponding with the relevant information
Sending method, which is sent to database and is executed, due to being directed to every a kind of special instruction, middleware is all set in advance
The sending method for having set the matching instruction of the special instruction enables database to be correctly identified by of sending method transmission
With instruction, therefore, database can correctly execute the matching instruction.
One embodiment according to the present invention, due to for certain special instructions, after database executes special instruction,
It can be directed to and send connection used in the special instruction, identify that the matching of the special instruction subsequently sent from the connection refers to
It enables, therefore, after middleware sends special instruction, the relevant information corresponding with the special instruction of record can be special to send this
Instruction uses the mark of connection.When middleware subsequently receives the matching instruction of the special instruction from the client, then in
Between part by the matching instruction by it is corresponding with the mark of record connection be sent to database execute.
Specifically, the relevant information corresponding with the special instruction when record uses connection by the transmission special instruction
When mark, after middleware receives the matching instruction of the special instruction, according to the transmission of record, the special instruction uses connection
When transmission special instruction then the matching instruction is sent to number by used connection by the connection before mark can determine
It is executed according to library.In this way, since middleware sends special instruction and its subsequent matching instruction being sent by the same connection
To database, therefore, database can correctly identify the matching instruction, so as to correct according to the same connection
Execute the matching instruction.
Further, one embodiment according to the present invention, when middleware transmission special instruction, and record is special with this
Instruct corresponding relevant information by the transmission special instruction using connection mark when, middleware send special instruction it
Afterwards, middleware can also be that database and client keep sending connection used in the special instruction, that is, middleware will be special
After instruction is sent to database by a connection, the connection is not recycled, other clients are not distributed into the connection yet
It uses, therefore, when the matching instruction of the subsequently received special instruction of middleware, the connection can be used directly and send the matching
Instruction improves the efficiency that middleware sends matching instruction.
One embodiment according to the present invention when middleware transmission special instruction, and records corresponding with the special instruction
Relevant information by the transmission special instruction using connection mark when, the instruction is the instruction of SQL statement form, should
Special instruction can be BEGIN statement (BEGIN statement, that is, the BEGIN TRANSCATION sentences in db transaction) or
PREPARE sentences.
Specifically, when special instruction is BEGIN statement, then the matching instruction of the special instruction is and the BEGIN statement
Belong to the sentence of the same db transaction, such as COMMIT sentences, ROLLBACK sentences.
It is illustrated below for db transaction:
One database transaction packet contains a plurality of SQL statement.One db transaction is started with BEGIN statement, and centre can
Including several sentences can submit the database thing when sentence all successful executions of BEGIN statement and centre with COMMIT sentences
Completed operation in business can be used when centre has sentence execution failure or the db transaction that cannot continue to execute
The ROLLBACK sentences rollback db transaction is shown that is, cancelling the operation for being completed in the db transaction but not yet submitting
So, a db transaction can be with COMMIT sentences or ROLLBACK Statement Completions.
Since multiple db transactions can be performed simultaneously in the database, in order not to obscure each db transaction, data
Library is identified all sentences of a db transaction using connection identifier (Identity, ID), wherein the connection identifier
By send the db transaction sentence use connection connection ID.If certain sentence of middleware transmission data library affairs with
The other sentences for sending the db transaction have used different connections, then database thinks that this sentence belongs to other sentences
Different db transactions, and it is identified with corresponding different connection IDs respectively, therefore, the database of each connection ID mark
The sentence of affairs is imperfect, causes database that can not correctly execute the sentence in the db transaction.
According to the above description, database is the sentence identified according to connection in the same db transaction, and therefore, it is necessary to will
Same all sentences of db transaction are sent by identical connection.Then when the relevant information of middleware record is to send special finger
Enable the connection ID for use and connecting, and the special instruction for BEGIN statement when, in step S101~S103 shown in Fig. 1, in
Between part send BEGIN statement, and record send the BEGIN statement use connection connection ID, when it is subsequently received and be somebody's turn to do
BEGIN statement belongs to other sentences of the same db transaction, such as when COMMIT sentences, ROLLBACK sentences, by this its
Its sentence is sent to database by the connection that the connection ID of record is identified and executes, then database can correctly execute other languages
Sentence.
It is illustrated below for PREPARE sentences, EXECUTE sentences and DEALLOCATE sentences:
When special instruction is PREPARE sentences, the matching instruction of the special instruction be EXECUTE sentences or
DEALLOCATE sentences (DEALLOCATE sentences, that is, DEALLOCATE PREPARE sentences), wherein the PREPARE sentences
In include templates statement (templates statement, that is, template instruct) and the statement title of the templates statement, the EXECUTE languages
It also include the statement title of the templates statement in sentence and the DEALLOCATE sentences.
PREPARE sentences state a templates statement, the statement title of the templates statement and the templates statement in advance
Undetermined parameter (templates statement can not include undetermined parameter yet).When database executes PREPARE sentences, for each
PREPARE sentences can be that the PREPARE sentences preserve one group of content, and use connection using the PREPARE sentences are sent
Connection ID preserves content to the group and is identified, wherein the group preserves content and includes:The template for including in the PREPARE sentences
The undetermined parameter of sentence, the statement title of the templates statement, the templates statement.
EXECUTE sentences contain the statement title of templates statement and the parameter value of templates statement.When database executes
When EXECUTE sentences, can according to send the EXECUTE sentences to inquire the connection ID using the connection ID of connection corresponding
The preservation content of PREPARE sentences, and each group inquired is preserved into the statement title of the templates statement in content and is somebody's turn to do
The statement title for the templates statement for including in EXECUTE sentences is compared, if certain group preserves the sound of the templates statement in content
Bright title is identical as the statement title for including in the EXECUTE sentences, then being according to the parameter value that the EXECUTE sentences include should
Group preserves the undetermined parameter assignment of the templates statement in content, and executes the templates statement after assignment.
DEALLOCATE sentences contain the statement title of templates statement.When database executes DEALLOCATE sentences,
Can according to send the DEALLOCATE sentences the guarantors of the corresponding PREPARE sentences of the connection ID is inquired using the connection ID of connection
Content is deposited, and includes with the DEALLOCATE sentences by the statement title of the templates statement in each group inquired preservation content
Templates statement statement title it is identical be compared, if the statement title of the templates statement in a certain group of preservation content with should
The statement title for the templates statement for including in EXECUTE sentences is identical, then deletes the group and preserve content.
According to the above description, database be according to connection identification PREPARE sentences and corresponding EXECUTE sentences and
DEALLOCATE sentences.If middleware sends PREPARE sentences, EXECUTE or DEALLOCATE sentences corresponding with transmission make
With different connections, then according to transmission, the corresponding EXECUTE or DEALLOCATE sentences use the connection connected to database root
ID cannot inquire the corresponding preservation content of the PREPARE sentences identified using another connection ID, not to database
The corresponding EXECUTE or DEALLOCATE sentences can correctly be executed.
Therefore, it is necessary to PREPARE sentences and corresponding EXECUTE sentences and/or DEALLOCATE sentences are passed through phase
It is sent with connection.One embodiment according to the present invention, when the relevant information of middleware record is used to send special instruction
The connection ID of connection, and it (includes templates statement and its statement in the PREPARE sentences that the special instruction, which is PREPARE sentences,
Title) when, in step S101~S103 shown in Fig. 1, middleware sends PREPARE sentences, and records and send the PREPARE
Sentence use connection connection ID, when it is subsequently received include the EXECUTE sentences of the statement title and/or
When DEALLOCATE sentences, the EXECUTE sentences and/or the DEALLOCATE sentences are identified by the connection ID of record
Connection is sent to database execution, then database can correctly execute the EXECUTE sentences and/or the DEALLOCATE sentences.
One embodiment according to the present invention when middleware transmission special instruction, and records corresponding with the special instruction
Relevant information when being the template instruction that the special instruction includes, in step S103 shown in Fig. 1, using preset and institute
The corresponding sending method of relevant information is stated, which, which is sent to database, executes, and specifically includes:Referred to according to the template
It enables and the matching instruction generates general instruction, the general instruction of generation, which is sent to database, to be executed.Wherein, according to the mould
Plate instructs and the matching instruction generates general instruction, specifically includes:Whether comprising undetermined in middleware judges template instruction
Template after assignment is instructed and is made if so, being the undetermined parameter assignment in the matching instruction according to the parameter value for including by parameter
For the general instruction of generation, otherwise, the general instruction by template instruction as generation.Wherein, the instruction is SQL statement
The instruction of form, the special instruction be PREPARE sentences, then the matching instruction of the special instruction be include the PREPARE languages
The EXECUTE sentences of the statement title for the templates statement that sentence includes.
When the relevant information of middleware record is that the template that special instruction includes instructs, and the special instruction is PREPARE
When sentence, in step S101~S103 shown in Fig. 1, middleware sends PREPARE sentences, and is directed to each PREPARE
Sentence records the templates statement that the PREPARE sentences include, and middleware also needs to preserve one group of content for the PREPARE sentences,
Wherein, group preservation content includes:The statement title of the templates statement, the templates statement that include in the PREPARE sentences, the mould
The undetermined parameter of plate sentence.When follow-up middleware receives the EXECUTE sentences of certain client transmission, inquire as from the client
The each group that the PREPARE sentences that end is sent preserve preserves content, and each group inquired is preserved the templates statement in content
Statement title is compared with the statement title for including in the EXECUTE sentences, if certain group preserves the templates statement in content
It states that title is identical as the statement title that the EXECUTE sentences include, in turn, judges that the templates statement that the group preserves in content is
No includes undetermined parameter, if so, being the templates statement in group preservation content with the parameter value that the EXECUTE sentences include
Undetermined parameter assignment, and be sent to the templates statement after assignment as general sentence (general sentence, that is, general instruction)
Database executes, and otherwise, which is preserved the templates statement in content and is sent to database execution as general sentence, due to number
Can directly execute the general sentence according to library, and the implementation effect of the general sentence be equivalent to the EXECUTE sentences execute effect
Fruit, therefore, database correctly performs the general sentence that is, database correctly performs the EXECUTE sentences.
In conjunction with Fig. 2 to 6, the specific practical application of the execution method of special instruction of the present invention is as follows:
Fig. 2 shows under the scene for applying middleware, the link between database, middleware and client
Structure.3 client C1~C3 access database by middleware, specifically, client C1~C3 is based on passing with middleware respectively
Transport control protocol view (Transmission Control Protocol, TCP) foundation has communication to connect, and the database of middleware connects
Meet database connection c1~c3 that Chi Zhongyou is pre-established.Wherein, database can be MySQL database, and the database connects
Connecing can be that java databases connect (Java Database Connectivity, JDBC).
Fig. 3 shows the matching for the special instruction and the special instruction that client is sent by middleware to database
The implementation procedure of instruction, specifically includes step:
S301:Client sends several special instructions to middleware.
It is assumed that being stored with tables of data Student (tables of data Student, hereinafter referred to as table Student), table in database
Student defines 5 data item:Sno、Sname、Ssex、Sage、Sdept.To after 5 data item difference assignment to Table A
Middle insertion produces a data record of table Student, 3 datas record D1~D3 is contained in current table Student,
Fig. 4 shows the current structures of table Student, each data that the first row expression table Student in table Student includes
, data record D1~D3 that the first row expression table table Student in table Student includes, row where certain data item with
It is the value of the data item in the data record in the cell of row intersection where certain data record.
Client C1 sends SQL statement S1 to middleware:
BEGIN TRANSCATION.It means:Start a db transaction.
Client C2 sends SQL statement S2 to middleware:
PREPARE incr FROM " INSERT INTO Student (Sno, Sname, Ssex, Sage, Sdept)
VALUES(,,,, CS) ".It means:The templates statement of one entitled incr of statement of pre- statement, wherein the templates statement
Incr is used to be inserted into a data record into table Student.
Client C3 sends SQL statement S3 to middleware:
PREPARE info FROM“SELECT*FROM Student”.It means:One entitled info of statement of pre- statement
Templates statement, wherein templates statement info be used for inquiry table Student in total data.
S302:Several special instructions are sent to data by middleware by distributing to the database connection of the client
Library, and it is directed to each special instruction, record the corresponding relevant information of the special instruction.
Database connection c1 in database connection pool is distributed to client C1 by middleware, and connecting c1 by database will
SQL statement S1 is sent to database, and the connection ID of database of record connection c1.It is client after middleware sends SQL statement S1
Hold C1 that database is kept to connect c1, that is, database connection c1 recycling not to be put into database connection pool or the distribution of middleware
It is used to other clients.
Database connection c2 in database connection pool is distributed to client C2 by middleware, and connecting c2 by database will
SQL statement S2 is sent to database, and preserves one group of relevant information of SQL statement S2, including:The mould for including in SQL statement S2
Plate sentence incr, the statement title " incr " of templates statement incr, templates statement incr four undetermined parameters " Sno, Sname,
Ssex, Sage ".Wherein, templates statement incr is:
INSERT INTO Student (Sno, Sname, Ssex, Sage, Sdept) VALUES (,,,, CS).
Database connection c3 in database connection pool is distributed to client C3 by middleware, and connecting c3 by database will
SQL statement S3 is sent to database, and preserves one group of relevant information of SQL statement S3, including:The mould for including in SQL statement S3
The statement title " info " of plate sentence info, templates statement info.Wherein, templates statement info is:
SELECT*FROM Student。
S303:Database executes the special instruction received from middleware, and is returned and executed to client by middleware
As a result.
Database successful execution SQL statement S1, opens a db transaction, and database connects the company of c1 with database
It meets ID to be identified SQL statement S1, then starts to monitor other languages from the database connection c1 db transactions sent
Sentence, and the response to run succeeded is returned to client by middleware.
Database successful execution SQL statement S2, the connection ID that c2 is connected with database identify and save SQL statement S2's
One group of relevant information, including:Include in SQL statement S2 templates statement incr " INSERT INTO Student (Sno,
Sname, Ssex, Sage, Sdept) VALUES (,,,, ' CS ') ", statement title " incr ", the template of templates statement incr
Four undetermined parameters " Sno, Sname, Ssex, the Sage " of sentence incr.Then start to monitor from database connection c2 transmissions
The match statement of SQL statement S2, and the response to run succeeded is returned to client by middleware.
Database successful execution SQL statement S3, the connection ID that c3 is connected with database identify and save SQL statement S3's
One group of relevant information, including:Templates statement info " SELECT*FROM Student ", the templates statement for including in SQL statement S3
The statement title " info " of info.Then start to monitor the match statement from the database connection c3 SQL statement S3 sent, and lead to
It crosses middleware and returns to the response to run succeeded to client.
S304:Client sends the matching instruction of special instruction to middleware.
Client C1 sends SQL statement S4 to middleware:
SELECT Sno, Sname FROM Student Where Ssex=' men '.It means:Number in inquiry table Student
According to item Ssex=' man ' data record data item Sno, Sname value.
Client C2 sends SQL statement S5 to middleware:
EXECUTE incr USING ' 20145124 ', ' Zhao six ', ' female ', 18.It means:With the parameter for including in the sentence
Value is templates statement incr assignment, and executes the sentence generated after assignment.
Client C3 sends SQL statement S6 to middleware:
EXECUTE info.It means:Execute templates statement info.
S305:Middleware is preset according to special instruction, and the corresponding relevant information of the special instruction of record, use
The matching instruction is sent to database by sending method.
SQL statement S4 is connected c1 by database and is sent to database by middleware.
Middleware is according to the mould that the parameter value for the templates statement for including in SQL statement S5 is that the SQL statement S2 preserved includes
Plate sentence assignment generates SQL statement S5 ':
INSERT INTO Student (Sno, Sname, Ssex, Sage, Sdept) VALUES (' 20145124 ', ' Zhao
Six ', ' female ', 18, ' CS ').It means:It is inserted into a data into table Student and records (Sno=' 20145124 ', Sname=
' Zhao six ', Ssex=' female ', Sage=18, Sdept=' CS ').
And the SQL statement S5 ' of generation is sent to database.
Middleware generates SQL statement S6 ' according to the templates statement that the SQL statement S3 of preservation includes:
SELECT*FROM Student.It means:Total data in inquiry table Student.
And the SQL statement S6 ' of generation is sent to database.Wherein, since the SQL statement S3 templates statements for including do not wrap
Containing undetermined parameter, then the SQL statement S6 generated is the templates statement info that SQL statement S3 includes.
S306:Database executes the sentence received from middleware, and returns to implementing result to client by middleware.
Database successful execution SQL statement S4, the corresponding data that will be inquired in table Student, and run succeeded
Response by middleware to client return.Wherein, Fig. 5 shows the corresponding data inquired, in table Student, number
According to item Ssex=' man ' data record be D1, D2, the value of the data item Sno and Sname of D1, D2 are SQL statement S4
Query result.
Database successful execution SQL statement S5 ', a new data item D4 is inserted into table Student, and pass through centre
Part returns to the response to run succeeded to client.Fig. 6 shows the knot of the table Student after database executes SQL statement S5 '
Structure, increase in table Student a new data item D4 (Sno=' 20145124 ', Sname=' Zhao six ', Ssex=' female ',
Sage=18, Sdept=' CS ').
Database successful execution SQL statement S6 ', the corresponding data that will be inquired in table Student, and run succeeded
Response by middleware to client return.Wherein, Fig. 6 shows the corresponding data inquired, as current table
Student。
It is a kind of execution method of special instruction provided in an embodiment of the present invention above, is based on same invention thinking, this
Inventive embodiments also provide a kind of executive device of special instruction, as shown in Figure 7.
Fig. 7 is the executive device structural schematic diagram of the special instruction of one embodiment according to the present invention, is specifically included:
First sending module 701 for sending special instruction, and records relevant information corresponding with the special instruction,
Wherein, the relevant information includes:Send the special instruction use connection mark and/or the special instruction include
Template instruction;
Receiving module 702, the matching instruction for receiving the special instruction;
Second sending module 703, the relevant information for being recorded according to first sending module 701, using pre-
If sending method corresponding with the relevant information, by the matching instruction be sent to database execute.
When the relevant information uses the mark of connection by the transmission special instruction, the second sending module tool
Body 703 is used for, by the matching instruction by with send the special instruction and use the corresponding connection transmission of the mark that connects
It is executed to database.
Described device further includes:
Keep module 704, for first sending module 701 send special instruction after, be the database and
The client keeps first sending module 701 to send connection used in the special instruction.
When the relevant information is the template instruction that the special instruction includes, second sending module 703 is specific
For generating general instruction according to template instruction and the matching instruction, the general instruction of generation being sent to data
Library executes.
Whether second sending module 703 is specifically used for, judge in the template instruction to include undetermined parameter, if so,
It is then the undetermined parameter assignment in the matching instruction according to the parameter value for including, by the template instruction after assignment as generation
General instruction, otherwise, by the template instruction as generation general instruction.
Described instruction includes:The instruction of structured query language SQL statement form;
When the relevant information uses the mark of connection by the transmission special instruction, the special instruction includes
BEGIN statement or PREPARE sentences, when the special instruction is BEGIN statement, the matching instruction is and the BEGIN
Sentence belongs to the sentence of the same db transaction, and when the special instruction is PREPARE sentences, the matching instruction is
EXECUTE sentences or DEALLOCATE sentences;
When the relevant information is the template instruction that the special instruction includes, the special instruction includes PREPARE
Sentence, the matching instruction include EXECUTE sentences.
Specifically, the executive device of above-mentioned special instruction as shown in Figure 7 can be located in middleware.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with teaching based on this.As described above, it constructs required by this kind of system
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that can utilize various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect
Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific implementation mode are expressly incorporated in the specific implementation mode, wherein each claim itself
All as a separate embodiment of the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment
Change and they are arranged in the one or more equipment different from the embodiment.It can be the module or list in embodiment
Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit requires, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization, or to run on one or more processors
Software module realize, or realized with combination thereof.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) realize the implantation letter in interception application program according to the ... of the embodiment of the present invention
The some or all functions of some or all components in the equipment of breath.The present invention is also implemented as executing here
Some or all equipment or program of device of described method are (for example, computer program and computer program production
Product).It is such to realize that the program of the present invention may be stored on the computer-readable medium, or can have one or more
The form of signal.Such signal can be downloaded from internet website and be obtained, and either be provided on carrier signal or to appoint
What other forms provides.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" or " comprising " are not arranged
Except there are element or steps not listed in the claims.Word "a" or "an" before element does not exclude the presence of more
A such element.The present invention can be by means of including the hardware of several different elements and by means of properly programmed calculating
Machine is realized.In the unit claims listing several devices, several in these devices can be by same
Hardware branch embodies.The use of word first, second, and third does not indicate that any sequence.It can be by these word solutions
It is interpreted as title.
This application can be applied to computer system/servers, can be with numerous other general or specialized computing system rings
Border or configuration operate together.Suitable for be used together with computer system/server well-known computing system, environment and/
Or the example of configuration includes but not limited to:Personal computer system, server computer system, thin client, thick client computer, hand
Hold or laptop devices, microprocessor-based system, set-top box, programmable consumer electronics, NetPC Network PC, small-sized meter
Calculation machine Xi Tong ﹑ large computer systems and distributed cloud computing technology environment, etc. including any of the above described system.
Computer system/server can be in computer system executable instruction (such as journey executed by computer system
Sequence module) general context under describe.In general, program module may include routine, program, target program, component, logic, number
According to structure etc., they execute specific task or realize specific abstract data type.Computer system/server can be with
Implement in distributed cloud computing environment, in distributed cloud computing environment, task is long-range by what is be linked through a communication network
Manage what equipment executed.In distributed cloud computing environment, program module can be positioned at the Local or Remote meter for including storage device
It calculates in system storage medium.
The present invention includes A7, a kind of executive device of special instruction, is coupled between database and client, described device
Including:
First sending module for sending special instruction, and records relevant information corresponding with the special instruction,
In, the relevant information includes:Send the special instruction use connection mark and/or the special instruction include
Template instructs;
Receiving module, the matching instruction for receiving the special instruction;
Second sending module, for the relevant information that record according to first sending module, using preset and
The matching instruction is sent to database and executed by the corresponding sending method of the relevant information.
A8, the device as described in claim A7, which is characterized in that when the relevant information is to send the special instruction
When using the mark of connection, second sending module is specifically used for, and it is described special with transmission that the matching instruction is passed through
Instruction institute using connection mark it is corresponding connection be sent to database execution.
A9, the device as described in claim A8, which is characterized in that described device further includes:
Module is kept, is the database and the visitor after sending special instruction in first sending module
Family end keeps first sending module to send connection used in the special instruction.
A10, the device as described in claim A7, which is characterized in that when the relevant information is the special instruction packet
When the template instruction contained, second sending module is specifically used for, and is generated according to template instruction and the matching instruction
The general instruction of generation is sent to database and executed by general instruction.
A11, the device as described in claim A10, which is characterized in that second sending module is specifically used for, and judges
Whether include undetermined parameter in the template instruction, if so, being described wait in the matching instruction according to the parameter value for including
Parameter assignment is determined, by the template instruction after assignment as the general instruction generated, otherwise, by template instruction as generation
General instruction.
A12, the device as described in claim A7~A11 is any, which is characterized in that described instruction includes:Structuring is looked into
Ask the instruction of language SQL statement form;
When the relevant information uses the mark of connection by the transmission special instruction, the special instruction includes
BEGIN statement or PREPARE sentences, when the special instruction is BEGIN statement, the matching instruction is and the BEGIN
Sentence belongs to the sentence of the same db transaction, and when the special instruction is PREPARE sentences, the matching instruction is
EXECUTE sentences or DEALLOCATE sentences;
When the relevant information is the template instruction that the special instruction includes, the special instruction includes PREPARE
Sentence, the matching instruction include EXECUTE sentences.