Movatterモバイル変換


[0]ホーム

URL:


CN117171194A - SQL query engine based on JDBC - Google Patents

SQL query engine based on JDBC
Download PDF

Info

Publication number
CN117171194A
CN117171194ACN202311075756.8ACN202311075756ACN117171194ACN 117171194 ACN117171194 ACN 117171194ACN 202311075756 ACN202311075756 ACN 202311075756ACN 117171194 ACN117171194 ACN 117171194A
Authority
CN
China
Prior art keywords
sql
interface
query engine
query
statement
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.)
Pending
Application number
CN202311075756.8A
Other languages
Chinese (zh)
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.)
Inspur Software Technology Co Ltd
Original Assignee
Inspur Software 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 Inspur Software Technology Co LtdfiledCriticalInspur Software Technology Co Ltd
Priority to CN202311075756.8ApriorityCriticalpatent/CN117171194A/en
Publication of CN117171194ApublicationCriticalpatent/CN117171194A/en
Pendinglegal-statusCriticalCurrent

Links

Landscapes

Abstract

The invention provides a SQL query engine based on JDBC, which belongs to the field of data query of relational databases, and comprises an SQL statement maintenance interface, wherein SQL statements are maintained according to categories of tree structures; the SQL debugging interface provides a debugging interface, debugs specified SQL sentences and checks the query result; the SQL parser is responsible for parsing SQL grammar; and the SQL calling interface is responsible for calling the SQL statement of the designated function ID and returning the result. The invention realizes the flexible and efficient query of the data of the relational database.

Description

Translated fromChinese
一种基于JDBC的SQL查询引擎A SQL query engine based on JDBC

技术领域Technical field

本发明涉及关系型数据库的数据查询领域,尤其涉及一种基于JDBC的SQL查询引擎。The invention relates to the field of data query of relational databases, and in particular to a JDBC-based SQL query engine.

背景技术Background technique

JDBC(Java Database Connectivity)称为Java数据库连接,是一个独立于特定数据库管理系统(DBMS)、通用的SQL数据库存取和操作的公共接口(一组API),定义了用来访问数据库的标准Java类库,使用这个类库可以以一种标准的方法、方便地访问数据库资源。JDBC (Java Database Connectivity) is called Java Database Connection. It is a public interface (a set of APIs) for general SQL database access and operation that is independent of a specific database management system (DBMS). It defines the standard Java used to access the database. Class library, use this class library to conveniently access database resources in a standard way.

JDBC为访问不同的数据库提供了一种统一的途径,为开发者屏蔽了一些细节问题。JDBC provides a unified way to access different databases, shielding developers from some details.

JDBC的目标是使Java程序员可以连接任何提供了JDBC驱动程序的数据库系统,这样就使得程序员无需对特定数据库系统的特点有过多的了解,从而大大简化和加快开发过程。The goal of JDBC is to enable Java programmers to connect to any database system that provides a JDBC driver. This eliminates the need for programmers to have too much knowledge about the characteristics of a specific database system, thus greatly simplifying and speeding up the development process.

JDBC提供了数据库访问的便利,但功能的实现与变动需要不断地修改实现代码,没有办法动态的传递参数,查询不能灵活快速的修改。JDBC provides the convenience of database access, but the implementation and changes of functions require continuous modification of the implementation code. There is no way to dynamically transfer parameters, and queries cannot be modified flexibly and quickly.

发明内容Contents of the invention

为了解决以上技术问题,本发明提供了一种基于JDBC的SQL查询引擎。小巧而高效,开箱即用,实现查询与后端程序的解耦。In order to solve the above technical problems, the present invention provides a JDBC-based SQL query engine. Small and efficient, it can be used out of the box to decouple queries from back-end programs.

本发明的技术方案是:The technical solution of the present invention is:

一种基于JDBC的SQL查询引擎,A JDBC-based SQL query engine,

包括include

SQL语句维护界面,按树形结构分门别类维护SQL语句;The SQL statement maintenance interface maintains SQL statements by category according to the tree structure;

SQL调试界面,提供了调试接口,调试指定SQL语句,查看查询结果;SQL debugging interface provides a debugging interface to debug specified SQL statements and view query results;

SQL解析器,负责解析SQL语法;SQL parser, responsible for parsing SQL syntax;

SQL调用接口,负责调用指定功能ID的SQL语句,并返回结果。The SQL calling interface is responsible for calling the SQL statement with the specified function ID and returning the result.

进一步的,further,

SQL语句维护界面设置的左侧功能树按照前台功能树的结构分门别类的存放SQL语句,右侧SQL编辑界面实现SQL语句的编写和保存。The function tree on the left set up in the SQL statement maintenance interface stores SQL statements in categories according to the structure of the front-end function tree. The SQL editing interface on the right realizes the writing and saving of SQL statements.

SQL语句维护界面可动态维护SQL语句,实现SQL语句与代码的解耦合。The SQL statement maintenance interface can dynamically maintain SQL statements and realize the decoupling of SQL statements and code.

进一步的,further,

SQL调试界面设置查询用到的参数,并通过功能ID调用SQL语句,并能直接返回查询结果。The SQL debugging interface sets the parameters used in the query, calls the SQL statement through the function ID, and can directly return the query results.

进一步的,further,

SQL解析器可以解析一种以上的SQL语法,以满足常规的关系型数据库数据查询。The SQL parser can parse more than one SQL syntax to satisfy regular relational database data queries.

语法包括WHERE、ORDER BY、LIMIT、GROUP BY,WHERE条件提供了特定写法,用于实现复杂条件和参数的解析。Syntax includes WHERE, ORDER BY, LIMIT, and GROUP BY. WHERE conditions provide specific writing methods for parsing complex conditions and parameters.

进一步的,further,

SQL调用接口提供了统一接口,实现指定SQL语句的调用。The SQL calling interface provides a unified interface to implement the calling of specified SQL statements.

进一步的,further,

调用解析器执行SQL,并将结果返回给SQL调试界面和前端界面。Call the parser to execute SQL and return the results to the SQL debugging interface and front-end interface.

本发明的有益效果是The beneficial effects of the present invention are

实现灵活高效地查询关系型数据库的数据。Achieve flexible and efficient query of data in relational databases.

附图说明Description of drawings

图1是本发明的结构框图;Figure 1 is a structural block diagram of the present invention;

图2是本发明的工作示意图。Figure 2 is a schematic diagram of the operation of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments These are some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without any creative work are protected by the present invention. scope.

本发明提供了,一种基于JDBC的小巧而高效的数据查询工具,开箱即用,实现对常见关系型数据库的数据查询,如图1所示,包括:The present invention provides a small and efficient data query tool based on JDBC, which can be used out of the box to realize data query on common relational databases. As shown in Figure 1, it includes:

SQL语句维护界面(101),提供了维护界面,左侧功能树可以按照前台功能树的结构分门别类的存放SQL语句,右侧SQL编辑界面实现SQL语句的编写和保存;The SQL statement maintenance interface (101) provides a maintenance interface. The function tree on the left can store SQL statements in categories according to the structure of the front-end function tree. The SQL editing interface on the right realizes the writing and saving of SQL statements;

SQL调试界面(102),提供了调试接口,可以设置查询用到的参数,并通过功能ID调用SQL语句,并能直接返回查询结果。The SQL debugging interface (102) provides a debugging interface, which can set the parameters used in the query, call the SQL statement through the function ID, and directly return the query results.

SQL解析器(103),负责解析SQL语法。WHERE、ORDER BY、LIMIT、GROUP BY等常见语法均可解析,WHERE条件也提供了特定写法,用于实现复杂条件和参数的解析。SQL parser (103), responsible for parsing SQL syntax. Common syntaxes such as WHERE, ORDER BY, LIMIT, and GROUP BY can all be parsed. WHERE conditions also provide specific writing methods for parsing complex conditions and parameters.

SQL调用接口(104),负责调用指定功能ID的SQL语句,并返回结果。The SQL calling interface (104) is responsible for calling the SQL statement with the specified function ID and returning the result.

如图2所示as shown in picture 2

SQL语句维护界面可以动态维护SQL语句。实现SQL语句与代码的解耦合。The SQL statement maintenance interface can dynamically maintain SQL statements. Realize the decoupling of SQL statements and code.

SQL解析器可以解析常见的多种SQL语法。满足常规的关系型数据库数据查询。The SQL parser can parse a variety of common SQL syntaxes. Meet conventional relational database data queries.

SQL调用接口提供了统一接口,实现指定SQL语句的调用。它起到了承上启下的作用,调用解析器执行SQL,并将结果返回给调试界面和前端界面。The SQL calling interface provides a unified interface to implement the calling of specified SQL statements. It serves as a link between the previous and the following, calling the parser to execute SQL and returning the results to the debugging interface and front-end interface.

前端界面和调试界面是具体用到SQL语句的地方。The front-end interface and debugging interface are where SQL statements are specifically used.

后台提供了维护界面用于维护SQL语句,保存后,可以直接在后台联调,查看SQL执行效果。也提供了API接口,前台通过功能ID直接调用SQL语句,将取得的结果展示到界面上。The backend provides a maintenance interface for maintaining SQL statements. After saving, you can directly jointly debug in the backend to view the SQL execution effect. An API interface is also provided. The front desk directly calls the SQL statement through the function ID and displays the obtained results on the interface.

查询引擎自带语法分析功能,可以实现SQL语句的动态解析,可以支持参数化的查询,界面调用的时候传入参数,自动对应到SQL的查询条件里,实现动态查询。The query engine has its own syntax analysis function, which can realize dynamic parsing of SQL statements and support parameterized queries. When the interface is called, parameters are passed in and automatically map to the SQL query conditions to achieve dynamic queries.

以上所述仅为本发明的较佳实施例,仅用于说明本发明的技术方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所做的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, are only used to illustrate the technical solutions of the present invention, and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.

Claims (9)

CN202311075756.8A2023-08-252023-08-25SQL query engine based on JDBCPendingCN117171194A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202311075756.8ACN117171194A (en)2023-08-252023-08-25SQL query engine based on JDBC

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202311075756.8ACN117171194A (en)2023-08-252023-08-25SQL query engine based on JDBC

Publications (1)

Publication NumberPublication Date
CN117171194Atrue CN117171194A (en)2023-12-05

Family

ID=88931126

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202311075756.8APendingCN117171194A (en)2023-08-252023-08-25SQL query engine based on JDBC

Country Status (1)

CountryLink
CN (1)CN117171194A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN119026156A (en)*2024-09-062024-11-26金航数码科技有限责任公司 A privileged account management and control method and device based on database limited query

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US6615214B1 (en)*1999-12-222003-09-02International Business Machines CorporationAccommodation of data definition statements in the sharing of dynamic SQL statements
US20100332473A1 (en)*2009-06-302010-12-30International Business Machines CorporationCorrelating queries issued by applications with their source lines and analyzing applications for problem determination and where used analysis
CN102110110A (en)*2009-12-282011-06-29中国移动通信集团公司Method and device for data access based on SOA (Service-Oriented Architecture)
CN109656942A (en)*2018-11-132019-04-19平安科技(深圳)有限公司Store method, apparatus, computer equipment and the storage medium of SQL statement
CN113032423A (en)*2021-05-312021-06-25北京谷数科技股份有限公司Query method and system based on dynamic loading of multiple data engines
CN114741279A (en)*2022-03-242022-07-12新华三大数据技术有限公司SQL statement debugging method, device and equipment
CN116303711A (en)*2023-02-152023-06-23东莞数汇大数据有限公司Method for configuring SQL to support dynamic query

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US6615214B1 (en)*1999-12-222003-09-02International Business Machines CorporationAccommodation of data definition statements in the sharing of dynamic SQL statements
US20100332473A1 (en)*2009-06-302010-12-30International Business Machines CorporationCorrelating queries issued by applications with their source lines and analyzing applications for problem determination and where used analysis
CN102110110A (en)*2009-12-282011-06-29中国移动通信集团公司Method and device for data access based on SOA (Service-Oriented Architecture)
CN109656942A (en)*2018-11-132019-04-19平安科技(深圳)有限公司Store method, apparatus, computer equipment and the storage medium of SQL statement
CN113032423A (en)*2021-05-312021-06-25北京谷数科技股份有限公司Query method and system based on dynamic loading of multiple data engines
CN114741279A (en)*2022-03-242022-07-12新华三大数据技术有限公司SQL statement debugging method, device and equipment
CN116303711A (en)*2023-02-152023-06-23东莞数汇大数据有限公司Method for configuring SQL to support dynamic query

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN119026156A (en)*2024-09-062024-11-26金航数码科技有限责任公司 A privileged account management and control method and device based on database limited query

Similar Documents

PublicationPublication DateTitle
US11907216B2 (en)Multi-language fusion query method and multi-model database system
CN111400297B (en)Hadoop-based mass data quality verification method
CN105260403B (en)General integration across database access method
US10942926B2 (en)Identification, and query, of semantically-related database tables
US9058360B2 (en)Extensible language framework using data cartridges
CN109614432B (en) A system and method for obtaining data blood relationship based on syntax analysis
CN117093599A (en)Unified SQL query method for heterogeneous data sources
CN106970819A (en)A kind of c program code specification check device based on the regular description languages of PRDL
CN110674229A (en)AST-based relational database SQL table relational analysis and display method
CN114090613A (en)Program statement conversion method, device, equipment and storage medium
US20090070300A1 (en)Method for Processing Data Queries
CN111309752A (en)Service flow data processing oriented domain specific language assembly and operation method thereof
CN111694846B (en)Separation mode distributed storage process implementation method based on Type 2JDBC driver
US9171036B2 (en)Batching heterogeneous database commands
US20050049999A1 (en)Database access statement tracing
WO2021259290A1 (en)Stored procedure conversion method and apparatus, and device and storage medium
CN117171194A (en)SQL query engine based on JDBC
CN114281842A (en) A kind of method and device for database sub-table query
US7496569B2 (en)Database access statement parser
CN107229672A (en)A kind of big data SQL query method and system for SolrCloud
US6925472B2 (en)Tree structure to pass data values to prepared statement object
US7174553B1 (en)Increasing parallelism of function evaluation in a database
CN111782195A (en)Query method based on adding annotation on request parameter and splicing into SQL
CN113157726A (en)Database processing method and device
CN116821180A (en)Control method supporting FlinkSQL data desensitization and electronic equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp