CN104462463B - Data access methods of the JavaScript based on SQL templates - Google Patents

Data access methods of the JavaScript based on SQL templates Download PDF

Info

Publication number
CN104462463B
CN104462463B CN201410787167.7A CN201410787167A CN104462463B CN 104462463 B CN104462463 B CN 104462463B CN 201410787167 A CN201410787167 A CN 201410787167A CN 104462463 B CN104462463 B CN 104462463B
Authority
CN
China
Prior art keywords
sql
data access
javascript
parameter
data
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
CN201410787167.7A
Other languages
Chinese (zh)
Other versions
CN104462463A (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 discloses a kind of data access methods of JavaScript based on SQL templates, provide JAVASCRIPT data access class libraries sqlmap and the SQL mould plate techniques of offer, realize dynamic data accessing mechanism;It can realize that JAVASCRIPT carries out data access based on the data access frame of SQL templates, quick data access method is provided, entire data access frame structure is simple, can effectively reduce the cost that project localization is implemented and transplanted, improve development efficiency.

Description

Data access methods of the JavaScript based on SQL templates
Technical field
The present invention relates to database development technical field, especially a kind of data access method.
Background technology
In current management information system software exploitation, data access is essential, in database technology, SQL statement is the main method of database manipulation.
Now main Web-based enterprise management information system software is developed with B/S browser models, AJAX Local hydrodynamic units Interaction aspect be WEB application exploitation mainstream, server-side generally use Hibernate such as JDBCTEMPLATE, HIBERNATE, IBATIS etc..Typically application framework is:JavaScript+Struts+Spring+Hibernate/ Ibatis。
The data access of existing WEB application is mainly the level by application framework, and UI layers use HTML+JavaScript The technologies such as+CSS, service layer is by the way of Struts request services, component layer is write using Spring modes, database access Component uses Hibernate or Ibatis frames.This data access frame level is more, for developing some complicated large sizes WEB application, current frame have certain technical management advantage, but complicated, and development rate is slow, for some small applications It is exactly less suitable, development cost correlation is higher.
Therefore need a kind of new technical solution to solve the above problems.
Invention content
The purpose of the present invention is in view of the deficienciess of the prior art, providing a kind of simple in structure can quickly develop Data access methods of the JavaScript based on SQL templates.
For achieving the above object, data access methods of the JavaScript of the present invention based on SQL templates can be used as Lower technical solution:
A kind of data access methods of the JavaScript based on SQL templates, provides JAVASCRIPT data access class libraries Sqlmap and the SQL mould plate techniques of offer realize dynamic data accessing mechanism;
Including following implemented step:
(a), SQL statement is provided when data access, SQL statement is the format of data standard, can also provide SQL statement number Group, data access frame are to be combined into correct SQL automatically;
(b), parameter object is provided when data access, parameter object is JAVASCRIPT objects;
(c), in WEB service layer, client is transmitted through the MAP objects that the required parameter string come is deserialized as in J2EE, Include all levels relationship of required parameter;
(d), SQL statement is parsed, the dynamic labels in template are analyzed, forms SQL syntax tree construction;
(e), dynamic analysis is carried out to parameter nomenclature placeholder in SQL syntax tree, generates executable SQL character strings;
(f) while by required parameter be placed in the root object of ONGL, by the expression language in SQL, access object it is arbitrary Attribute, the method for calling object.
The present invention can realize that JAVASCRIPT carries out data access based on the data access frame of SQL templates, provide Quick data access method, entire data access frame structure is simple, can effectively reduce project localization and implement and transplant Cost, improve development efficiency.
Description of the drawings
Fig. 1 is the schematic diagram of data access frames of the JavaScript based on SQL templates in the present invention.
Specific implementation mode
Term is explained:
In the following with reference to the drawings and specific embodiments, the present invention is furture elucidated, it should be understood that these embodiments are merely to illustrate It the present invention rather than limits the scope of the invention, after having read the present invention, those skilled in the art are to of the invention each The modification of kind equivalent form falls within the application range as defined in the appended claims.
As shown in Figure 1, the present invention provides JAVASCRIPT data access class libraries sqlmap, which can provide Following API approach:
sqlmap.queryforlist
sqlmap.queryforstring
sqlmap.queryforint
sqlmap.queryfordate
sqlmap.update。
Further, SQL mould plate techniques are provided, realize that dynamic data accessing mechanism, SQL templates provide<where>,<if >,<set>,<choose>,<when>Dynamic labels.
The present invention includes following implemented step:
(a), SQL statement is provided when data access, SQL statement is the format of data standard, can also provide SQL statement number Group, data access frame are to be combined into correct SQL automatically;
(b), parameter object is provided when data access, parameter object is JAVASCRIPT objects, and the present invention is by parameter object Do the persistence processing of character string, the HTTP request parameter string that form can be transmitted in a browser;
(c), in WEB service layer, client is transmitted through the MAP that the required parameter string come is deserialized as in J2EE by the present invention Object includes all levels relationship of required parameter;
(d), SQL statement is parsed, the dynamic labels in template are analyzed, forms SQL syntax tree construction;
(e), dynamic analysis is carried out to parameter nomenclature placeholder in SQL syntax tree, generates executable SQL character strings;
(f) while by required parameter be placed in the root object of ONGL, by the expression language in SQL, access object it is arbitrary Attribute, the method for calling object.
Scheme provided by the invention can realize that JAVASCRIPT carries out data based on the data access frame of SQL templates It accesses, quick data access method is provided, can effectively reduce the cost that project localization is implemented and transplanted, improve exploitation effect Rate.

Claims (2)

1. a kind of data access methods of JavaScript based on SQL templates, which is characterized in that provide JAVASCRIPT data and visit Class libraries sqlmap and the SQL mould plate techniques of offer are provided, realize dynamic data accessing mechanism;
Including following implemented step:
(a), data access when SQL statement is provided, SQL statement is the format of data standard, can also provide SQL statement array, Data access frame is to be combined into correct SQL automatically;
(b), data access when parameter object is provided, parameter object is JAVASCRIPT objects;
(c), in WEB service layer, client is transmitted through the MAP objects that the required parameter string come is deserialized as in J2EE, including The all levels relationship of required parameter;
(d), parsing SQL statement, the dynamic labels in template are analyzed, formed SQL syntax tree construction;
(e), in SQL syntax tree to parameter nomenclature placeholder carry out dynamic analysis, generate executable SQL character strings;
(f)While required parameter being placed in the root object of ONGL, by the expression language in SQL, the arbitrary category of access object Property, the method for calling object.
2. data access methods of the JavaScript according to claim 1 based on SQL templates, it is characterised in that:SQL moulds Plate 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 CN104462463A (en) 2015-03-25
CN104462463B true 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)

Families Citing this family (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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1869592A2 (en) * 2005-04-06 2007-12-26 Merck & Co., Inc. Multi-fielded web browser-based searching of data stored in database

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN104462463A (en) 2015-03-25

Similar Documents

Publication Publication Date Title
AU2021212135B2 (en) Building and managing data-processing attributes for modelled data sources
US9483260B1 (en) Documentation generation for web APIs based on byte code analysis
CN104461484B (en) The implementation method and device of front-end template
US8949792B2 (en) Methods and systems for data service development
US9015657B2 (en) Systems and methods for developing and delivering platform adaptive web and native application content
CN106575298A (en) Fast rendering of websites containing dynamic content and stale content
KR102593171B1 (en) Information processing method and device, electronic equipment and storage medium
Vasiļjevs et al. Letsmt!: cloud-based platform for do-it-yourself machine translation
JP2015501993A5 (en)
US8688752B2 (en) Method and system for deploying a model-based application to an application server
US20170185608A1 (en) App Onboarding System For Developer-Defined Creation Of Search Engine Results
Mao et al. Online visualization of 3D city model using CityGML and X3DOM
Sheppard wq: A modular framework for collecting, storing, and utilizing experiential VGI
CN104166545B (en) The sniff method and device of a kind of web page resources
CN104462463B (en) Data access methods of the JavaScript based on SQL templates
Hsu Visual modeling for web 2.0 applications using model driven architecture approach
CN106293862A (en) A kind of analysis method and device of expandable mark language XML data
CN105488147A (en) Persistence method based on SQL (Structured Query Language) template
Hilliard OPTIMISING VIEWER COMPREHENSION AND SHAPING IMPRESSIONS AND ATTENTION: through the formatting of content in tools like Microsoft® PowerPoint®
CN107077484B (en) Generating a web browser view of an application
Janev et al. Linked Open Data Infrastructure for Public Sector Information: Example from Serbia.
Zhao et al. Research and achievement of UI patterns and presentation layer framework
US20130305213A1 (en) Modularized customization of a model in a model driven development environment
US10642931B1 (en) Systems and methods for producing more meaningful web services descriptions via automated cross-reference of external information sources
CN105808212A (en) Extension method and system of product support tool

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