CN116541446A - Database management method - Google Patents
Database management method Download PDFInfo
- Publication number
- CN116541446A CN116541446A CN202310473746.3A CN202310473746A CN116541446A CN 116541446 A CN116541446 A CN 116541446A CN 202310473746 A CN202310473746 A CN 202310473746A CN 116541446 A CN116541446 A CN 116541446A
- Authority
- CN
- China
- Prior art keywords
- connection
- database
- resource
- pool
- determining
- 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
Links
- 238000007726 management method Methods 0.000 title claims abstract description 20
- 238000000034 method Methods 0.000 claims description 14
- 239000000523 sample Substances 0.000 claims 2
- 239000000758 substrate Substances 0.000 claims 2
- 230000008033 biological extinction Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000010076 replication Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Abstract
The invention provides a database management method, which belongs to the field of database management. The database management of a plurality of intervention systems is realized, and the troubles of switching environments and databases are avoided.
Description
Technical Field
The invention relates to the field of database management, in particular to a database management method.
Background
And (3) connecting a pool: a certain number of connections are put into the buffer pool in advance, and when the database connection needs to be established, only one connection needs to be taken out of the buffer pool, and the connection is put back after the use is finished. The database connection pool is responsible for allocating, managing and releasing database connections, which allows applications to reuse an existing database connection instead of reestablishing one.
JDBC: java database connectivity, (Java Database Connectivity, JDBC for short) is an application program interface in Java language that is used to specify how client programs access a database, providing methods such as querying and updating data in the database. JDBC is also a trademark of Sun Microsystems. We generally speak of JDBC being relational database oriented.
RESTful API: the RESTful API is an architectural style of an Application Program Interface (API) that accesses or uses data with HTTP requests. These data may be used for GET, PUT, POST, and DELETE data types, which refer to operations read, update, create, and DELETE associated with a resource.
There are two problems with the current database management: first: only a single database can be managed, and the cost of switching databases is high. Second,: the user is required to be familiar with the development of SQL to query the data desired to be queried through SQL.
For the first problem, management of a plurality of databases, although can be solved by creating a plurality of connections, the overhead of creating connections and destroying connections places a great burden on the system.
For the second problem, the database is operated by the command line to inquire the resources of the database, and operations such as start-stop copying of the database need to have a certain database experience.
Disclosure of Invention
In order to solve the technical problems, the invention provides a database management method.
The technical scheme of the invention is as follows:
a database management method accesses a database to be managed through a front-end page or calling a RESTful API interface provided by a back-end, thereby realizing resource management and functional operation of the database.
Further, the method comprises the steps of,
when the system is accessed, the system can establish the connection with the target database through jdbc and put the connection in the connection pool, so that the manageability of the connection can be improved, the cost of connection establishment and extinction is reduced, and the performance is improved.
CRUD operation or copy, start and stop functional operation is carried out on database resources through a front-end page or a RESTful API interface provided by a back-end, a request sent to the back-end through the RESTful API interface can carry out corresponding logic judgment through resource positioning, then corresponding JDBC connection is fetched from a connection pool through resource positioning, and corresponding sql sentences are generated and sent to a target database.
Still further, the method comprises the steps of,
accessing the target database through the connection address, the user name and the password information of the target database;
when the database is operated, the idle connection is obtained from the connection pool, the connection is returned to the connection pool after the use, and when the database is withdrawn, the connection of all the databases is disconnected and the memory resource is released.
Whenever a connection is requested, the pool data source will acquire a new connection from the pool of available connections. The connection pool will create a new connection only when there are no connections available and the maximum number of connections is not reached.
The resource location of the RESTful API may further enable the backend to determine the operation of the corresponding database, including: GET retrieves the resource; PUT changes state or updates state of the resource; the POST creates the resource; DELETE resource.
After the database executes the corresponding sql, the back end can take the return value from the connection and package the return value, and return the return value to the caller or the front end interface, so that the caller can manage and operate the target database without knowing the corresponding sql logic or creating the database connection.
After operating the database through the connection, the close () method of the connection is called to return the connection to the connection pool instead of actually closing it.
The invention has the beneficial effects that
Related resources of the database can be displayed more intuitively through the page, and the control of the database can be realized by clicking operation buttons such as start and stop, copy and the like of the database. The operator can manage the database without the need for the associated development experience.
Meanwhile, databases of a plurality of intervention systems can be managed, and the troubles of switching environments and databases are avoided.
Drawings
Fig. 1 is a schematic of the workflow of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
The invention provides a database management method, which establishes corresponding connection by inserting a database to be managed into a platform system, thereby realizing resource management and functional operation of the database.
Users want to manage multiple databases more comprehensively, and besides adding, deleting and checking resources, users want to perform one-key operation of starting, stopping, copying and other functions on the databases.
First, to implement management of multiple databases, the database management system provides an access function, and the database to be managed may be accessed through a front-end page or calling a RESTful API interface provided by the back-end. The user can access the target database into the management system by only providing the information such as the connection address, the user name, the password and the like of the target database, and when the user accesses the target database, the system can establish the connection with the target database through jdbc and put the connection into the connection pool, so that the manageability of the connection can be improved, the cost of connection establishment and extinction is reduced, and the performance is improved. When the system is initialized, a connection pool is created, idle connection is obtained from the connection pool when a program operates the database, the connection is returned to the connection pool after the program is used, and when the system is withdrawn, the connection of all the databases is disconnected and memory resources are released. Whenever a connection is requested, the pool data source will acquire a new connection from the pool of available connections. The connection pool will create a new connection only when there are no connections available and the maximum number of connections is not reached.
After the target database is accessed into the system, database management and operation can be performed, wherein the method is characterized in that CRUD operation or copy, start and stop and other functional operations are performed on database resources through a front-end page or a RESTful API interface provided by a back-end, a request sent to the back-end through the RESTful API interface can be subjected to corresponding logic judgment through resource positioning, then corresponding JDBC connection is acquired from a connection pool through resource positioning, and corresponding sql sentences are generated and sent to the target database.
The resource location of the RESTful API may also enable the backend to determine the operation of the corresponding database more clearly and simply, for example: GET retrieves the resource; PUT changes state or updates state of resources (database replication, start-stop, etc. functional operations); the POST creates the resource; DELETE resource.
After the database executes the corresponding sql, the back-end system can take the return value from the connection and package the return value, and return the return value to the caller or the front-end interface, so that the caller can manage and operate the target database without knowing the corresponding sql logic or creating the database connection.
It should be noted that after operating the database through a connection, the close () method of the connection is called to return the connection to the connection pool instead of actually closing it. Thereby achieving reusability of the connection.
The foregoing description is only illustrative of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (8)
1. A database management method is characterized in that,
the database to be managed is accessed through a front-end page or a RESTful API interface provided by the back-end, so that the resource management and the functional operation of the database are realized.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
upon access, a connection is created with the target database through jdbc and placed in the connection pool.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
CRUD operation or copy, start and stop functional operation is carried out on database resources through a front-end page or a RESTful API interface provided by a back-end, a request sent to the back-end through the RESTful API interface can carry out corresponding logic judgment through resource positioning, then corresponding JDBC connection is fetched from a connection pool through resource positioning, and corresponding sql sentences are generated and sent to a target database.
4. The method of claim 3, wherein the step of,
accessing the target database through the connection address, the user name and the password information of the target database;
when the database is operated, the idle connection is obtained from the connection pool, the connection is returned to the connection pool after the use, and when the database is withdrawn, the connection of all the databases is disconnected and the memory resource is released.
5. The method of claim 4, wherein the step of determining the position of the first electrode is performed,
whenever a connection is requested, the pool data source will acquire a new connection from the pool of available connections; the connection pool will create a new connection only when there are no connections available and the maximum number of connections is not reached.
6. The method of claim 5, wherein the step of determining the position of the probe is performed,
the resource location of the RESTful API may further enable the backend to determine the operation of the corresponding database, including: GET retrieves the resource, PUT changes state or updates the state of the resource, POST creates the resource, DELETE DELETEs the resource.
7. The method of claim 6, wherein the step of providing the first layer comprises,
after the database executes the corresponding sql, the back end can take the return value from the connection and package the return value, and return the return value to the caller or the front end interface, so that the caller can manage and operate the target database without knowing the corresponding sql logic or creating the database connection.
8. The method of claim 7, wherein the step of determining the position of the probe is performed,
after operating the database through the connection, the close () method of the connection is called to return the connection to the connection pool instead of actually closing it.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310473746.3A CN116541446A (en) | 2023-04-28 | 2023-04-28 | Database management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310473746.3A CN116541446A (en) | 2023-04-28 | 2023-04-28 | Database management method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116541446A true CN116541446A (en) | 2023-08-04 |
Family
ID=87446326
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310473746.3A Pending CN116541446A (en) | 2023-04-28 | 2023-04-28 | Database management method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116541446A (en) |
-
2023
- 2023-04-28 CN CN202310473746.3A patent/CN116541446A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7181474B2 (en) | Database communication system and method for communicating with a database | |
US8335805B2 (en) | Universal data management interface | |
EP2548137B1 (en) | Distributed event system for relational models | |
US10891291B2 (en) | Facilitating operations on pluggable databases using separate logical timestamp services | |
US7571164B2 (en) | System and method for deferred database connection configuration | |
US7739290B2 (en) | System and method for object persistence | |
WO2018233364A1 (en) | Index updating method and system, and related device | |
US20080281846A1 (en) | High performant row-level data manipulation using a data layer interface | |
US10242057B2 (en) | Distributed system with accelerator and catalog | |
JP5357068B2 (en) | Information processing apparatus, information processing system, data archive method, and data deletion method | |
JP2006012155A (en) | System and method for delayed fetching of designated members of user defined type | |
US6901417B2 (en) | Method, system, and program for updating records in a database when applications have different version levels | |
US20090228429A1 (en) | Integration of unstructed data into a database | |
US8655853B2 (en) | System and method for optimizing database transaction termination | |
CA2379930A1 (en) | Multi-model access to data | |
KR101400214B1 (en) | Appratus for providing a hybrid c interface | |
CN112395264A (en) | Processing method for mapping between logical target and volume in distributed storage system | |
CN116541446A (en) | Database management method | |
JP2001312422A (en) | Method and device for document batch management and recording medium | |
WO2003081464A2 (en) | Database system comprising database access object with cache | |
CN114153438A (en) | API automatic generation system | |
CN107590199A (en) | A kind of multi-thread data storehouse design method towards internal memory | |
Song et al. | An e-Learning system based on GWT and Berkeley DB | |
KR101063577B1 (en) | Schema and stored procedure real-time management system and method of large database | |
CN110866034B (en) | Server throttling method and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |