Aspects of the invention relate generally to database access. More particularly, various aspects of the invention relate to accessing data via one or more Java Database Connectivity (JDBC) drivers.
Some data access programs inefficiently retrieve data. For example, some Java access programs utilize SELECT statements that grab all of the columns of data in a table, when only a small subset of that data is desired. The conventional solution to this problem has been to utilize a data access grid. In the case of a data access grid, a Java virtual machine (JVM) stores a subset of data in a grid after it is retrieved from a database. However, JVMs require external database access infrastructure to be effective, which can be costly and time consuming to implement. In addition, data access grids have a limited capacity.
Solutions for querying desired data from a database without pulling supererogatory data are disclosed herein. In one embodiment, a method includes: obtaining an initial database access query between the application and the database at the self-learning JDBC driver; monitoring subsequent database access queries between the application and the database over a period; and generating a modified database access query for querying the database from the self-learning JDBC driver, the modified database access query based upon the subsequent database access queries between the application and the database over the period.
A first aspect includes a computer-implemented method of managing a Java Database Connectivity (JDBC) driver data query at a self-learning JDBC driver interposed between an application and a database, the method including: obtaining an initial database access query between the application and the database at the self-learning JDBC driver; monitoring subsequent database access queries between the application and the database over a period; and generating a modified database access query for querying the database from the self-learning JDBC driver, the modified database access query based upon the subsequent database access queries between the application and the database over the period.
A second aspect includes a system having: at least one computing device associated with a Java Database Connectivity (JDBC) driver interposed between an application and a database, the at least one computing device configured to manage a data query at the self-learning JDBC driver by performing actions including: obtaining an initial database access query between the application and the database at the self-learning JDBC driver; monitoring subsequent database access queries between the application and the database over a period; and generating a modified database access query for querying the database from the self-learning JDBC driver, the modified database access query based upon the subsequent database access queries between the application and the database over the period.
A third aspect includes a computer program comprising program code embodied in at least one computer-readable storage medium, which when executed, enables a computer system interposed between an application and a database to manage a Java Database Connectivity (JDBC) driver data query by performing actions including: obtaining an initial database access query between the application and the database at the self-learning JDBC driver; monitoring subsequent database access queries between the application and the database over a period; and generating a modified database access query for querying the database from the self-learning JDBC driver, the modified database access query based upon the subsequent database access queries between the application and the database over the period.
These and other features of this invention will be more readily understood from the following detailed description of the various aspects of the invention taken in conjunction with the accompanying drawings that depict various embodiments of the invention, in which:
It is noted that the drawings of the invention are not necessarily to scale. The drawings are intended to depict only typical aspects of the invention, and therefore should not be considered as limiting the scope of the invention. In the drawings, like numbering represents like elements between the drawings.
As indicated herein, embodiments disclosed relate to database access. In particular, various embodiments relate to self-learned database access querying at a Java Database Connectivity (JDBC) driver.
Referring to the schematic environment 120 in
In practice, an initial query 125 requesting data from the database 110 is sent from the application 100 to the database system 110 through the JDBC driver 105. The JDBC driver 105 acts as an intermediary, transferring the database access query command from the application 100 to the database system 110. In return, the database system 110 sends a data return 415 (
Referring to
Process P1: Obtaining an initial database access query 125 between the application 100 and the database 110 at the self-learning JDBC driver 105. As previously discussed, the self-learning JDBC driver 105 is interposed between the application 100 and the database system 110. The self-learning JDBC driver 105 observes SQL statements (e.g., initial database query 125) sent from the application 100. The SQL statements include requests from the application to retrieve data from the database system 110.
Process P2: Monitoring subsequent database access queries 130 between the application 100 and the database 110 over a period. In an embodiment, the JDBC driver 105 is configured to actively learn from the database queries that it processes. That is, the JDBC driver 105 observes the results of the initial database query 125 and begins to aggregate the probability that the requested data is being utilized by the application 100. Based on the observation, the JDBC driver 105 can predict the data that will be used in subsequent database queries 130. It is understood that “period” may refer to, e.g., a time, a count, or any other division or subdivision of data collection.
Process P3: Generating a modified database access query 210 for querying the database 100 from the self-learning JDBC driver 105, the modified database access query 210 based upon the subsequent database access queries 130 between the application 100 and the database 110 over the period. The JDBC driver 105 uses the observations of initial database query results to create tailored, modified database access queries 210 at the JDBC driver 105 that target the data utilized from a prior data return. Upon a subsequent database access query 130 from an application 100, the JDBC driver 105 sends the modified database access query 210 instead of the subsequent database query 130. The process may be executed repeatedly until an override function is triggered. In another embodiment, the JDBC driver 105 is capable of sending multiple modified database access queries 210 in response to multiple unique subsequent database access queries 130.
Process P4: Delivering data obtained by the modified database access query 210 to the application 100 from the database 110. The modified database access query 210, retrieves a modified set of data consisting of a portion or a subset of data 400 from an initial database request data return 415 (See
Process P5: Monitoring a further subsequent database access query 430 between the application 100 and the database 110, the further subsequent database access query 430 being initiated after the modified database access query 210. In an embodiment, after a modified database query 210, the JDBC driver is capable of monitoring a further subsequent database access query 430. The method is similar to that of monitoring a subsequent database access query, wherein the JDBC driver 105 observes the results of the further subsequent database query 430 and begins to aggregate the probability that the requested data is being utilized by the consuming application 100.
Process P6: Generating a subsequent modified database access query 210 for querying the database 110 from the self-learning JDBC driver 105, the generating of the subsequent modified database access query 210 being based upon the further subsequent database access query 430. The JDBC driver 105 uses the observations of the subsequent modified database query results to create tailored, modified database access queries 210 at the JDBC driver 105 that target the data utilized from a prior data return. Upon a further subsequent database access query 430 from an application 100, the JDBC driver 105 sends the modified database access query 210 instead of the further subsequent database query 430. The process may be executed repeatedly until an override function is triggered.
Process P7: Delivering a second set of data 420 in response to an incomplete data call, wherein the incomplete data call is sent between the application 100 and the database 110 in response to a delivery of an inaccurate subset of data. Another embodiment of the process includes sending a second set of data 420 in the event that a delivery of a subset of data 400 from a modified database access query 210 is inaccurate. The subset of data 400 may be inaccurate when it does not contain data required by the application 100. In response to a subsequent database access query 130, a modified database access query 210 is sent to the database 110, and a subset of data 400 is returned to the consuming application 100 as shown in
Process P8: Terminating the modified database access query 210 in response to an override function 405 (See
Turning to
As demonstrated in
For example, the consuming application may issue a SELECT statement on a 10 column table as follows: SELECT*FROM TESTABLE. From ResultSet that is issued, only two of the ten columns may be utilized by the consuming application. To avoid the unnecessary transfer of eight additional columns of data, one embodiment of the self-learning JDBC driver 105 may proactively inform the database system 110 to change the query from: SELECT*FROM TESTABLE to SELECT column1, column2 FROM TESTTABLE. As
In various embodiments described herein, the terms “application” or “program”, may include, for example, Java applications using JDBC drivers 105 to connect to back end data bases, applications using Java persistence Architecture (JPA) and/or any Object Relation Mapping (ORM) framework. Further, the terms “database” or “database structure”, or “database system” as used in this disclosure, may include: federated databases, non-SQL databases, relational databases and/or master data management (MDM) databases. “Query”, “database access query”, and all variations thereof as described herein may include: select, insert results, insert values, update, delete, and/or joins.
The computer system 500 is shown including a processing component 505 (e.g., one or more processors), a storage component 520 (e.g., a storage hierarchy), an input/output (I/O) component 510 (e.g., one or more I/O interfaces and/or devices), and a communications pathway 515. In general, the processing component 505 executes program code, such as the JDBC Driver 105, which is at least partially fixed in the storage component 520. While executing program code, the processing component 505 can process data, which can result in reading and/or writing transformed data from/to the storage component 520 and/or the I/O component 510 for further processing. The pathway 515 provides a communications link between each of the components in the computer system 500. The I/O component 510 can comprise one or more human I/O devices, which enable a human user 530 to interact with the computer system 500 and/or one or more communications devices to enable a system user 530 to communicate with the computer system 500 using any type of communications link.
The computer system 500 can comprise one or more general purpose computing articles of manufacture (e.g., computing devices) capable of executing program code, such as the JDBC driver 105, having a learning engine 525, installed thereon. As used herein, it is understood that “program code” means any collection of instructions, in any language, code or notation, that cause a computing device having an information processing capability to perform a particular function either directly or after any combination of the following: (a) conversion to another language, code or notation; (b) reproduction in a different material form; and/or (c) decompression. To this extent, JDBC driver 105 can be embodied as any combination of system software and/or application software.
Further, the self-learning JDBC driver 105 can be implemented using a set of modules. In this case, a module can enable the computer system 500 to perform a set of tasks used by the self-learning JDBC driver 105, and can be separately developed and/or implemented apart from other portions of the self-learning JDBC driver 105. As used herein, the term “component” means any configuration of hardware, with or without software, which implements the functionality described in conjunction therewith using any solution, while the term “module” means program code that enables the computer system 500 to implement the functionality described in conjunction therewith using any solution. When fixed in a storage component 520 of a computer system 500 that includes a processing component 505, a module is a substantial portion of a component that implements the functionality. Regardless, it is understood that two or more components, modules, and/or systems may share some/all of their respective hardware and/or software. Further, it is understood that some of the functionality discussed herein may not be implemented or additional functionality may be included as part of the computer system 500.
When the computer system 500 comprises multiple computing devices, each computing device may have only a portion of the JDBC driver fixed thereon (e.g., one or more modules). However, it is understood that the computer system 500 and JDBC driver 105 are only representative of various possible equivalent computer systems that may perform a process described herein. To this extent, in other embodiments, the functionality provided by the computer system 500 and JDBC driver 105, having a learning engine 525, can be at least partially implemented by one or more computing devices that include any combination of general and/or specific purpose hardware with or without program code. In each embodiment, the hardware and program code, if included, can be created using standard engineering and programming techniques, respectively.
Regardless, when the computer system 500 includes multiple computing devices, the computing devices can communicate over any type of communications link. Further, while performing a process described herein, the computer system 500 can communicate with one or more other computer systems using any type of communications link. In either case, the communications link can comprise any combination of various types of wired and/or wireless links; comprise any combination of one or more types of networks; and/or utilize any combination of various types of transmission techniques and protocols.
The computer system 500 can obtain or provide data, such as database access queries (e.g., initial database access query 125) and/or data returns (e.g., initial data return 415) using any solution. For example, the computer system 500 can generate and/or be used to generate database queries from one or more data stores, receive return data from another system, and/or send data to another system.
While shown and described herein as self-learning JDBC driver 105, it is understood that aspects of the invention further provide various alternative embodiments. For example, in one embodiment, the invention provides a computer program fixed in at least one computer-readable medium, which when executed, enables a computer system to manage a Java Database Connectivity (JDBC) driver data query at a self-learning JDBC driver 105 interposed between an application 100 and a database 110. To this extent, the computer-readable medium includes program code, such as the JDBC driver 105, having a learning engine 525 (
In another embodiment, the invention provides a method of providing a copy of program code, such as the JDBC driver 105, having a learning engine 525 (
In various embodiments of the invention, the self-learning JDBC driver queries data that is static in nature and does not dynamically change the data that it is accessing. However, other embodiments may include accessing databases that are not static in nature. In an embodiment, the JDBC driver 105 replaces a modified database access query 210 with a new modified query in response to the addition of data to the database 110. For example, if a new column or table is added to the database system 110 after a modified database access query 210, the JDBC driver 105 can learn of this new addition and undo the previously modified database access query 210. This enables the JDBC driver 105 to re-learn the new pattern of data access by the application 100 based upon the updated query. The user may be able to select a setting for their JDBC connection to specify that the application should take advantage of the self-learning JDBC driver 105 in a static or non-static data transfer.
The foregoing description of various aspects of the invention has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed, and obviously, many modifications and variations are possible. Such modifications and variations that may be apparent to an individual in the art are included within the scope of the invention as defined by the accompanying claims.