Method for accessing relational databases of different types

A database and relational technology, applied in the field of relational databases, can solve problems such as complexity and workload, and achieve the effect of reducing complexity, shielding database types, and executing efficiency advantages

Inactive Publication Date: 2010-02-10
INSPUR COMMON SOFTWARE
View PDF0 Cites 49 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

According to the needs of the market and customers, it is necessary to support multiple types of relational databases and versions at the same time, and the above-mentioned differences in access forms and methods at the database level bring additional complexity and workload to the development of enterprise applications at the database level

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for accessing relational databases of different types

Examples

Experimental program
Comparison scheme
Effect test

example 1

[0030] SQL Server: SELECT SubString(Code, 1, 3) FROM T WHERE ID=@p1

[0031] Oracle: SELECT SubStr(Code, 1, 3) FROM T WHERE ID=: p1

[0032] The above is the first three characters of the Code field in the row where the specified ID is obtained from the table T in SQL development. The SQL difference between SQL Server and Oracle database is shown above.

[0033] The unified packaging shown in the present invention is as follows:

[0034] SQL: SELECT{F:SubStr(Code,1,3)} FROM T WHERE ID={0}

[0035] When the above SQL is executed, it will be matched to a specific database execution object according to the configuration item. The execution object will perform a regular expression search on the text that matches the replacement, match and transform according to the content in the curly braces, and replace the original SQL text The curly braces part of, finally get the SQL statement executable on the target database.

example 2

[0037] SQL Server: ALTER TABLE T ALTER COLUMN COL1 VARCHAR(10)

[0038] Oracle: ALTER TABLE T MODIFY COL1 VARCHAR(10)

[0039] The above is in development, modify the SQL of column COL1 in table T, the SQL difference between SQL Server and Oracle database is shown above.

[0040] For SQL statements with large differences, the SQL statement compatibility method is not used, and the system provides a programming interface for encapsulation:

[0041] C#: void AlterColumn(string tblName, string colName, string property);

[0042] In the defined programming interface, an AlterColumn method is provided to modify the field properties of the database. There are three parameters, namely table name, field name, and field property. The program call source code for this example is as follows:

[0043] C#: AlterColumn("T", "COL1", "VARCHAR(10)");

[0044] The above example 1 and example 2 respectively illustrate the method of defining database access standards in two forms: SQL specification and prog...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a method for accessing relational databases of different types, comprising the following steps: encapsulating aiming at difference by analyzing and identifying the differenceof the relational databases of different types and editions; externally providing a consistent programming access interface in an assembly way, uniformly transferring a standard and a writing form foran SQL statement syntax and various database functions and commands and shielding the difference caused by the relational databases of different types and editions; internally respectively and pointedly realizing the shielding of the difference according to the types and the editions of the databases, and when the difference of the types and the editions of the databases is shielded, using two methods, i.e. the programming access interface and the SQL statement syntax, to encapsulate the difference. The two methods can be used together, therefore not only the effect on shielding the difference of the types and the editions of the databases can be achieved but also the complexity of realizing programming can be lower; meanwhile, the invention is lighter and has obvious advantages on execution efficiency corresponding to a way of using a complete private SQL statement syntax to define, analyze and translate the SQL statement syntax.

Description

Technical field [0001] The invention relates to the field of relational databases, and in particular to a method for an application program to access a plurality of different types and versions of relational databases in an indiscriminate manner. Background technique [0002] At present, relational database storage is the mainstream way of enterprise storage and data application. Popular large-scale relational databases include Oracle, SQL Server, IBM DB2, SyBase, Informix, etc., and each database generally has multiple parallel versions in use ( For example, Oracle 9i, Oracle 10g). Many relational database types follow or support consistent SQL language standards (such as ANSI / ISO SQL99, SQL92). However, various databases have extended some non-standard SQL based on this standard, and the data type definitions of various databases are not uniform. For the realization of the same functions, the functions and system commands provided by various databases are inconsistent. Even t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30
Inventor 孙立新郑伟波赵启杰
Owner INSPUR COMMON SOFTWARE
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products