CN101436184B - Batch data operating method - Google Patents

Batch data operating method Download PDF

Info

Publication number
CN101436184B
CN101436184B CN2007101703748A CN200710170374A CN101436184B CN 101436184 B CN101436184 B CN 101436184B CN 2007101703748 A CN2007101703748 A CN 2007101703748A CN 200710170374 A CN200710170374 A CN 200710170374A CN 101436184 B CN101436184 B CN 101436184B
Authority
CN
China
Prior art keywords
batch
database
statement
batches
operating method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2007101703748A
Other languages
Chinese (zh)
Other versions
CN101436184A (en
Inventor
彭璐
龚银
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN2007101703748A priority Critical patent/CN101436184B/en
Publication of CN101436184A publication Critical patent/CN101436184A/en
Application granted granted Critical
Publication of CN101436184B publication Critical patent/CN101436184B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a batch data operating method, which comprises the steps of generating batch connecting objects according to database connecting objects, the batch connecting objects providing description information of the database for the connection of the database and conversation, packaging the database connection, entrusting an executive request of the database to a batch senstence object for unified centralized treatment; generating the batch sentence object, the batch sentence object preserving pre-compiled batch executive sentence of the database, unifiedly performing a database access to the parameters respectively transferred and preserved multi-time execution; and executing database sentences. The batch data operating method can process batch database operations by the object-oriented mode and simultaneously performs transparentizing treatment on the batch database operations to increase the transparency of application programs on the batch database operations, so that users and the application programs do not need to know and care details of driver; and partial jdbc driver operations can also be strengthened.

Description

A kind of batch data operating method
Technical field
The present invention relates to electric digital data processing field, particularly batch data operating method.
Background technology
In application program; need carry out a large amount of batch operations and processing to database through regular meeting; the large-scale application system of more complicated particularly; very high to performance requirement; by using the batch operation interface can allow to carry out all data base manipulation statements rather than carry out a series of of database are called at same db transaction; can reduce the lot of data storehouse in this way connects and operational processes, the performance of elevator system greatly.General approximate implementation is the batch operation that carries out data by direct use jdbc batch interface at present.
Fig. 1 illustrates a kind of treatment scheme of prior art, comprising:
Step S11, obtain database and connect;
Step S12, creation statement (statement) object;
Step S13, structure need the complete sql statement of execution;
Step S14, the sql statement that needs are carried out is increased in the batch statement tabulation of statement object;
Step S15, judge whether all sql statements all to be increased in the batch statement tabulation of statement object, increased all sql statements and then carried out step S16, carry out step S13 otherwise return;
Step S16, execution batch processing action on statement object, accessing database is also carried out statement in batches;
Step S17, close statement object are connected with database, and treatment scheme finishes.
Adopt prior art, it is normally opaque to use jdbc driver one class to do the database batch operation, and runs counter to oo (object-oriented) processing mode, especially obvious in ormapping (Object Relation Mapping technology) class realizes.
Summary of the invention
The object of the present invention is to provide a kind of batch data operating method of handling the operation of batch data storehouse.
The invention provides a kind of batch data operating method, comprise: produce the step of connecting object in batches according to database connection object, the descriptor that described batch connecting object provides database to the connection and the session of database, the encapsulation of data storehouse connects, and entrusting to the execution request of data in batches, the statement object unification focuses on; Generation is the step of statement object in batches, and described batch statement object is preserved compiled in advance database perform statement in batches, and for transmitting and preserve the parameter of repeatedly carrying out respectively, a database access is carried out in unification; When carrying out described batch statement object, whether the inspection of described batch statement object has batch operation, when finding batch operation is arranged, the batch processing sign is set in inside, database manipulation of ability concentrative implementation is directly carried out database manipulation for the database statement that does not have the batch processing sign when waiting for always that for the database statement that has the batch processing sign connecting object is closed in batches.
Preferably, above-mentioned step according to database connection object generation batch connecting object comprises: the step of obtaining database connection object; Step according to database connection object packaging structure batch connecting object; Return the step of connecting object in batches.
Preferably, above-mentioned generation is the step of statement object in batches: the readiness database statement, and structure is the step of statement object in batches; Database statement is increased to step in the in batches command list (CLIST); Close the step of connecting object in batches; Close the step of statement object in batches.
When above-mentioned batch connecting object is carried out closing motion, travel through this all batch statement object of connecting object in batches, and the execution close statement behavior of statement object in batches successively, when closing the batch statement object, the batch processing method that directly calls JDBC API carries out the actual access and the statement execution of database.
Batch data operating method provided by the invention can be handled the operation of batch data storehouse by OO mode; Make transparence simultaneously and handle, increase the transparency of application program to the database batch operation, user and application program do not need to understand and be concerned about the detail of driver; Also can strengthen part jdbcdriver operation.
Description of drawings
Fig. 1 is a kind of treatment scheme synoptic diagram of prior art of the present invention;
Fig. 2 is the object relationship figure of first embodiment of the invention;
Fig. 3 is the processing sequence chart of first embodiment of the invention;
Fig. 4 is the workflow synoptic diagram of first embodiment of the invention.
The realization of the object of the invention, functional characteristics and advantage will be in conjunction with the embodiments, are described further with reference to accompanying drawing.
Embodiment
Present embodiment proposes to connect driver (hereinafter to be referred as JDBC Driver) provides the transparency by the API of encapsulation and interception JDBC batch data operation based on the Java database.The present embodiment definition also encapsulates two classes, and one is batch connecting object (BatchConnection), and another is a batch statement object (BatchPrepareStatement).Wherein in batches connecting object comprises table information, the database grammer of support etc. to some descriptors that the connection and the session of certain database provides database.Connecting object has encapsulated the connection of general data storehouse in batches, and entrusting to the execution request of data in batches, the statement object unification focuses on.And statement object is preserved compiled in advance database batch perform statement in batches, and repeatedly carrying out only needs to transmit parameter, and parameter is preserved, and finally only need carry out an actual database visit and get final product, and can greatly improve execution efficient.The object relationship of connecting object and batch statement object and JDBC Driver as shown in Figure 2 in batches, precompile statement object interface (PreparedStatement) provides the realization standard of precompile statement, database connecting interface (Connection) provides the realization that is connected with database standard, connecting object and batch statement object are followed Decorator (decorator) pattern in batches, directly realize JDBC Driver relevant interface, and the relevant JDBC API of parcel, interception and modification JDBC API corelation behaviour, interception part jdbc driver operation, and strengthen the batch processing that part jdbc driver operates, use-pattern and performance.
JDBC is made of two-layer, and ground floor is called JDBC API, second layer JDBC manager drivers/API, and JDBC API is communicated to JDBC manager drivers/API with sql command.The JDBC manager should be communicated by letter with the various third party's drivers that are physically connected to database, returns Query Information or the execution operation by the inquiry appointment then.The Java code passes to the DB2JDBC driver with SQL statement as function call.Then, driver handles is from the JDBC API Calls of client computer Java code.Batch connecting object that present embodiment proposes and batch statement object are special realizations of JDBC driving data storehouse connecting interface and precompile statement object interface.
In conjunction with Fig. 3, the processing sequence of present embodiment is: obtain a connecting object example in batches, obtain the method that directly to obtain precompile statement object interface behind this example, the method is directly returned an example of statement object in batches, in fact unactual direct accessing database when carrying out the batch statement object, but call the addBatch interface of precompile statement object interface, this statement is increased to JDBC API batch processing interface, whether the statement object inspection has batch operation in batches simultaneously, the batch processing sign just is set in inside when finding batch operation is arranged, follow-uply like this can judge whether needs executable operations at once, if having the batch processing sign then wait for when connecting object is closed in batches just database manipulation of concentrative implementation always according to the batch processing sign; If there is no the batch processing sign then adopts prior art to carry out database manipulation.When the batch connecting object is carried out closing motion, travel through this all batch statement object of connecting object in batches, and the execution close statement behavior of statement object in batches successively, when closing the batch statement object, the batch processing method that directly calls JDBC AP worker carries out the actual access and the statement execution of database.The addBatch interface of above-mentioned precompile statement object interface is used to increase the order of sql statement to batch processing tabulation the inside, so that follow-up precompile statement object is once carried out all statement orders.
With reference to Fig. 4, the workflow of present embodiment comprises:
Step S21, obtain general data storehouse connecting object;
Step S22, the database connection object by producing, packaging structure go out a connecting object in batches, return a connecting object in batches;
Step S23, structure sql statement, structure is statement object in batches;
Step S24, the sql statement is increased to during in batches statement object is tabulated in batches, the batch processing sign just is set in inside when finding batch operation is arranged;
Step S25, close in batches connecting object;
Step S26, execution be the closing motion of the batch statement object of connecting object association in batches;
Step S27, batch statement object are carried out and are closed;
Step S28, detection batch processing sign if there is the batch processing sign, then carries out step S29, otherwise carry out steps 5210;
Step S29 carries out the batch processing task, and accessing database carries out database manipulation;
Step 5210, directly closing database connects and statement;
Step 521 1, close the statement object that statement object in batches comprises, flow process finishes.
Above-mentioned workflow arrangement is as shown in table 1, only need know that concerning the user connecting object gets final product in batches, other operation and behavior all are transparent to the user.
Table 1
Other several data storehouses that the present invention also can be applicable to except that the Java database connects driver connect driver, handle and send journey similar to the above embodiments, so do not give unnecessary details.
The above only is the preferred embodiments of the present invention; be not so limit claim of the present invention; every equivalent structure or equivalent flow process conversion that utilizes instructions of the present invention and accompanying drawing content to be done; or directly or indirectly be used in other relevant technical fields, all in like manner be included in the scope of patent protection of the present invention.

Claims (4)

1. batch data operating method comprises:
Produce the step of connecting object in batches according to database connection object, the descriptor that described batch connecting object provides database to the connection and the session of database, the encapsulation of data storehouse connects, and entrusting to the execution request of data in batches, the statement object unification focuses on;
Generation is the step of statement object in batches, and described batch statement object is preserved compiled in advance database perform statement in batches, and for transmitting and preserve the parameter of repeatedly carrying out respectively, a database access is carried out in unification;
When carrying out described batch statement object, whether the inspection of described batch statement object has batch operation, when finding batch operation is arranged, the batch processing sign is set in inside, database manipulation of ability concentrative implementation is directly carried out database manipulation for the database statement that does not have the batch processing sign when waiting for always that for the database statement that has the batch processing sign connecting object is closed in batches.
2. batch data operating method according to claim 1 is characterized in that, described step according to database connection object generation batch connecting object comprises:
Obtain the step of database connection object;
Step according to database connection object packaging structure batch connecting object;
Return the step of connecting object in batches.
3. batch data operating method according to claim 1 is characterized in that, the described step of statement object in batches that generates:
The readiness database statement, structure is the step of statement object in batches;
Database statement is increased to step in the in batches command list (CLIST);
Close the step of connecting object in batches;
Close the step of statement object in batches.
4. according to any described batch data operating method of claim 1 to 3, it is characterized in that, when described batch connecting object is carried out closing motion, travel through this all batch statement object of connecting object in batches, and carry out the close statement behavior of described batch statement object successively, when closing the batch statement object, the batch processing method that directly calls JDBC API carries out the actual access and the statement execution of database.
CN2007101703748A 2007-11-15 2007-11-15 Batch data operating method Active CN101436184B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101703748A CN101436184B (en) 2007-11-15 2007-11-15 Batch data operating method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101703748A CN101436184B (en) 2007-11-15 2007-11-15 Batch data operating method

Publications (2)

Publication Number Publication Date
CN101436184A CN101436184A (en) 2009-05-20
CN101436184B true CN101436184B (en) 2011-08-03

Family

ID=40710625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101703748A Active CN101436184B (en) 2007-11-15 2007-11-15 Batch data operating method

Country Status (1)

Country Link
CN (1) CN101436184B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120158763A1 (en) * 2010-12-17 2012-06-21 Microsoft Corporation Bulk operations
CN102521408B (en) * 2011-12-27 2015-04-08 北京人大金仓信息技术股份有限公司 Method for accessing flat file by using java database connectivity (JDBC) interface
CN102521409B (en) * 2011-12-28 2015-04-08 北京人大金仓信息技术股份有限公司 Method for updating data of database in batch mode based on communication protocol
CN104699455B (en) * 2014-01-24 2017-10-10 杭州海康威视数字技术股份有限公司 Carry out method, system and the warning keyboard of alarm host machine setting
CN107608994A (en) * 2016-07-12 2018-01-19 深圳联友科技有限公司 A kind of method and system of batch processing SQL statement insertion database
CN109299125B (en) * 2018-10-31 2021-05-28 中国银行股份有限公司 Database updating method and device
CN112395138B (en) * 2020-11-20 2024-04-02 北京华胜天成科技股份有限公司 Method and device for checking parameters

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1713169A (en) * 2004-06-24 2005-12-28 国际商业机器公司 Systems and methods for sharing application data in a networked computing environment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1713169A (en) * 2004-06-24 2005-12-28 国际商业机器公司 Systems and methods for sharing application data in a networked computing environment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
刘宪军.Oracle JDBC事务的优化.装备指挥技术学院学报15 3.2004,15(3),101-104.
刘宪军.Oracle JDBC事务的优化.装备指挥技术学院学报15 3.2004,15(3),101-104. *
杨树林、胡洁萍.JDBC访问数据库的优化策略.北京印刷学院学报14 4.2006,14(4),48-51.
杨树林、胡洁萍.JDBC访问数据库的优化策略.北京印刷学院学报14 4.2006,14(4),48-51. *

Also Published As

Publication number Publication date
CN101436184A (en) 2009-05-20

Similar Documents

Publication Publication Date Title
CN101436184B (en) Batch data operating method
US7805341B2 (en) Extraction, transformation and loading designer module of a computerized financial system
Kaur et al. Implementation of IoT in various domains
CN103425726B (en) Open data are accessed using business intelligence tool
CN103853543B (en) A kind of method for being applied to rapid build list in enterprise information system development process
CN106126540B (en) Data base access system and its access method
CN107451220A (en) A kind of distributed NewSQL Database Systems
CN109857801B (en) Intelligent irrigation area e platform based on four-layer architecture and data processing method
CN101110030A (en) Developing method for data base persistence layer based on JAVA
CN108694214A (en) Generation method, generating means, readable medium and the electronic equipment of data sheet
CN110096278B (en) Extensible embedded man-machine interface tool implementation method
CN107515887A (en) A kind of interactive query method suitable for a variety of big data management systems
US20110106853A1 (en) Declarative model security pattern
US11061964B2 (en) Techniques for processing relational data with a user-defined function (UDF)
CN109710220B (en) Relational database query method, relational database query device, relational database query equipment and storage medium
US20090187927A1 (en) Method for invoking UOML instructions
CN110727659B (en) Decision tree model generation method, device, equipment and medium based on SQL (structured query language) sentences
EP2577508B1 (en) Systems and methods for providing multilingual support for data used with a business intelligence server
CN1662011A (en) System and method for building component applications using metadata defined mapping between message and data domains
CN108345691B (en) Data source general processing framework construction method, data source processing method and device
CN110019314A (en) Dynamic data packaging method, client and server-side based on data item analysis
CN109254808A (en) Interface call method, device and computer readable storage medium
CN109840267A (en) A kind of ETL process system and method
CN105138646A (en) Database operation method based on Hibernate
O'Brien et al. SEEK: Accomplishing enterprise information integration across heterogeneous sources.

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant