CN104462463A - JavaScript data access method based on SQL template - Google Patents

JavaScript data access method based on SQL template Download PDF

Info

Publication number
CN104462463A
CN104462463A CN201410787167.7A CN201410787167A CN104462463A CN 104462463 A CN104462463 A CN 104462463A CN 201410787167 A CN201410787167 A CN 201410787167A CN 104462463 A CN104462463 A CN 104462463A
Authority
CN
China
Prior art keywords
sql
data access
sqlmap
javascript
template
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.)
Granted
Application number
CN201410787167.7A
Other languages
Chinese (zh)
Other versions
CN104462463B (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.)
Nanjing LES Information Technology Co. Ltd
Original Assignee
Nanjing LES Information Technology 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 Nanjing LES Information Technology Co. Ltd filed Critical Nanjing LES Information Technology Co. Ltd
Priority to CN201410787167.7A priority Critical patent/CN104462463B/en
Publication of CN104462463A publication Critical patent/CN104462463A/en
Application granted granted Critical
Publication of CN104462463B publication Critical patent/CN104462463B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a JavaScript data access method based on an SQL template. The method has the advantages that a dynamic data access mechanism is achieved by providing a JAVASCRIPT data access class library and the SQL template technology; JAVASCRIPT data access based on the data access framework of the SQL template can be achieved, a fast data access method is achieved, the whole data access framework is simple in structure, cost of project local implementation and transplantation can be lowered effectively, and development efficiency is increased.

Description

JavaScript is based on the data access method of SQL template
Technical field
The present invention relates to database development technical field, especially a kind of data access method.
Background technology
In the exploitation of current management information system software, data access is absolutely necessary, and in database technology, SQL statement is the main method of database manipulation.
Web-based enterprise management information system software is now main is develop with B/S browser model, the mutual aspect of AJAX Local hydrodynamic unit is the main flow of WEB application exploitation, and service end generally adopts Hibernate as JDBCTEMPLATE, HIBERNATE, IBATIS etc.Typical application framework is: JavaScript+Struts+Spring+Hibernate/Ibatis.
The data access of existing WEB application mainly presses the level of application framework, UI layer uses the technology such as HTML+JavaScript+CSS, service layer adopts the mode of Struts request service, component layer to use Spring mode to write, and database access component uses Hibernate or Ibatis framework.This data access framework level is more, and for the large-scale WEB application of some complexity of exploitation, current framework has certain technical management advantage, but complex structure, tempo of development is slow, is exactly not too suitable for some compact applications, and cost of development is relevant higher.
Therefore, need a kind of new technical scheme to solve the problem.
Summary of the invention
The object of the invention is the deficiency existed for prior art, provide a kind of structure simply can the JavaScript of fast Development based on the data access method of SQL template.
For achieving the above object, JavaScript of the present invention can adopt following technical scheme based on the data access method of SQL template:
JavaScript is based on a data access method for SQL template, and the SQL mould plate technique providing JAVASCRIPT data access class libraries sqlmap and provide, realizes dynamic data accessing mechanism;
Comprise following performing step:
A provide SQL statement when (), data access, SQL statement is the form of data standard, also can provide SQL statement array, data access framework is automatically be combined into correct SQL;
B provide parameter object when (), data access, parameter object is JAVASCRIPT object;
(c), at WEB service layer, client is passed the required parameter string of coming and is deserialized as MAP object in J2EE, comprise all levels relation of required parameter;
D (), parsing SQL statement, analyze the dynamic labels in template, form SQL syntax tree structure;
(e), in SQL syntax tree to parameter name placeholder carry out dynamic analysis, generate executable SQL character string;
(f), required parameter is inserted the root object of ONGL simultaneously, by the expression language in SQL, any attribute of access object, the method for allocating object.
The present invention can realize JAVASCRIPT and carry out data access based on the data access framework of SQL template, data access method is fast provided, whole data access framed structure is simple, effectively can reduce the cost that project localization is implemented and transplanted, improve development efficiency.
Accompanying drawing explanation
Fig. 1 be in the present invention JavaScript based on the schematic diagram of the data access framework of SQL template.
Embodiment
Terminological interpretation:
Below in conjunction with the drawings and specific embodiments, illustrate the present invention further, these embodiments should be understood only be not used in for illustration of the present invention and limit the scope of the invention, after having read the present invention, the amendment of those skilled in the art to the various equivalent form of value of the present invention has all fallen within the application's claims limited range.
As shown in Figure 1, the invention provides JAVASCRIPT data access class libraries sqlmap, this sqlmap object can provide following API method:
sqlmap.queryforlist
sqlmap.queryforstring
sqlmap.queryforint
sqlmap.queryfordate
sqlmap.update。
Further, SQL mould plate technique is provided, realize dynamic data accessing mechanism, SQL template provides <where>, <if>, <set>, <choose>, <when> dynamic labels.
The present invention includes following performing step:
A provide SQL statement when (), data access, SQL statement is the form of data standard, also can provide SQL statement array, data access framework is automatically be combined into correct SQL;
B provide parameter object when (), data access, parameter object is JAVASCRIPT object, parameter object is done the persistence process of character string by the present invention, the HTTP request parameter string that form can be transmitted in a browser;
(c), at WEB service layer, client is passed the required parameter string of coming and is deserialized as MAP object in J2EE by the present invention, comprises all levels relation of required parameter;
D (), parsing SQL statement, analyze the dynamic labels in template, form SQL syntax tree structure;
(e), in SQL syntax tree to parameter name placeholder carry out dynamic analysis, generate executable SQL character string;
(f), required parameter is inserted the root object of ONGL simultaneously, by the expression language in SQL, any attribute of access object, the method for allocating object.
Scheme provided by the invention can realize JAVASCRIPT and carry out data access based on the data access framework of SQL template, provides data access method fast, effectively can reduce the cost that project localization is implemented and transplanted, improve development efficiency.

Claims (3)

1. JavaScript is based on a data access method for SQL template, it is characterized in that, the SQL mould plate technique providing JAVASCRIPT data access class libraries sqlmap and provide, realizes dynamic data accessing mechanism;
Comprise following performing step:
A provide SQL statement when (), data access, SQL statement is the form of data standard, also can provide SQL statement array, data access framework is automatically be combined into correct SQL;
B provide parameter object when (), data access, parameter object is JAVASCRIPT object;
(c), at WEB service layer, client is passed the required parameter string of coming and is deserialized as MAP object in J2EE, comprise all levels relation of required parameter;
D (), parsing SQL statement, analyze the dynamic labels in template, form SQL syntax tree structure;
(e), in SQL syntax tree to parameter name placeholder carry out dynamic analysis, generate executable SQL character string;
(f), required parameter is inserted the root object of ONGL simultaneously, by the expression language in SQL, any attribute of access object, the method for allocating object.
2. JavaScript according to claim 1 is based on the data access method of SQL template, it is characterized in that, sqlmap object provides following API method:
sqlmap.queryforlist
sqlmap.queryforstring
sqlmap.queryforint
sqlmap.queryfordate
sqlmap.update。
3. JavaScript according to claim 1 and 2 is based on the data access method of SQL template, it is characterized in that: SQL template provides <where>, <if>, <set>, <choose>, <when> dynamic labels.
CN201410787167.7A 2014-12-17 2014-12-17 Data access methods of the JavaScript based on SQL templates Active CN104462463B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410787167.7A CN104462463B (en) 2014-12-17 2014-12-17 Data access methods of the JavaScript based on SQL templates

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410787167.7A CN104462463B (en) 2014-12-17 2014-12-17 Data access methods of the JavaScript based on SQL templates

Publications (2)

Publication Number Publication Date
CN104462463A true CN104462463A (en) 2015-03-25
CN104462463B CN104462463B (en) 2018-08-14

Family

ID=52908498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410787167.7A Active CN104462463B (en) 2014-12-17 2014-12-17 Data access methods of the JavaScript based on SQL templates

Country Status (1)

Country Link
CN (1) CN104462463B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488147A (en) * 2015-11-26 2016-04-13 南京莱斯信息技术股份有限公司 Persistence method based on SQL (Structured Query Language) template
CN108959496A (en) * 2018-06-26 2018-12-07 南京汇银迅信息技术有限公司 Integration across database access method and abstract data access method based on dynamic proxy

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060230032A1 (en) * 2005-04-06 2006-10-12 Brankov Branimir I Multi-fielded Web browser-based searching of data stored in a database
CN101582066A (en) * 2008-05-13 2009-11-18 阿里巴巴集团控股有限公司 Website system and data exchange method based on same
CN103473311A (en) * 2013-09-11 2013-12-25 北京新学堂网络科技有限公司 Method and device for introducing external database into HTML5 application

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060230032A1 (en) * 2005-04-06 2006-10-12 Brankov Branimir I Multi-fielded Web browser-based searching of data stored in a database
CN101582066A (en) * 2008-05-13 2009-11-18 阿里巴巴集团控股有限公司 Website system and data exchange method based on same
CN103473311A (en) * 2013-09-11 2013-12-25 北京新学堂网络科技有限公司 Method and device for introducing external database into HTML5 application

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488147A (en) * 2015-11-26 2016-04-13 南京莱斯信息技术股份有限公司 Persistence method based on SQL (Structured Query Language) template
CN108959496A (en) * 2018-06-26 2018-12-07 南京汇银迅信息技术有限公司 Integration across database access method and abstract data access method based on dynamic proxy

Also Published As

Publication number Publication date
CN104462463B (en) 2018-08-14

Similar Documents

Publication Publication Date Title
CN104461484B (en) The implementation method and device of front-end template
Rautenbach et al. Orchestrating OGC web services to produce thematic maps in a spatial information infrastructure
Holzschuher et al. Querying a graph database–language selection and performance considerations
CN103309806B (en) The device and method of a kind of quick development and testing
GB2576654A (en) Method and apparatus for facilitating creation of simulation model
US11176125B2 (en) Blended retrieval of data in transformed, normalized data models
CN105518673B (en) Managing data ingestion
CN103729463A (en) Method for implementing full-text retrieval based on Lucene and Solr
Vasiļjevs et al. Letsmt!: cloud-based platform for do-it-yourself machine translation
KR101588592B1 (en) Hybrid application development system based on object relational mapping and the method thereof
CN108509199A (en) Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation
US9104724B2 (en) Dynamic bridging of application and data servers
US8688752B2 (en) Method and system for deploying a model-based application to an application server
WO2021253641A1 (en) Shading language translation method
CN106776779B (en) Method for generating entity file by JSON data based on Mac platform
CN105468793A (en) Automated management method for simulation model data
CN104699758A (en) Intelligent generation system and method of graphic library-associated command document
CN113962597A (en) Data analysis method and device, electronic equipment and storage medium
CN104462463A (en) JavaScript data access method based on SQL template
CN105488147A (en) Persistence method based on SQL (Structured Query Language) template
CN104462157A (en) Method and device for secondary structuralizing of text data
Vincent et al. OpenDig: In-field data recording for archaeology and cultural heritage
CN106293862A (en) A kind of analysis method and device of expandable mark language XML data
Hilliard OPTIMISING VIEWER COMPREHENSION AND SHAPING IMPRESSIONS AND ATTENTION: through the formatting of content in tools like Microsoft® PowerPoint®
CN109033447B (en) Face recognition data visualization system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant