1. A method of processing a plurality of queries, comprising: determining, at a database driver, whether a first query and a second query are similar, the first query being sent from a first execution thread executing in an application server, wherein the first and second queries are similar if the first and second queries include a set of common database tables from which to select data; and in response to a determination that the first and second queries are similar: determining a distinct set of conditions included in a conditions clause in the first and second queries; generating, at the database driver, a union query based on the first and second queries, wherein the union query includes the set of common database tables and each condition of the distinct set of conditions; submitting the union query to a database that stores the set of common database tables from which data is selected based on the first and second queries; receiving a combined result set of the union query from the database; submitting the first query against the combined result set; and receiving, at the database driver, a first result set of the first query in response to submitting the first query against the combined result set.
1. A method of processing a plurality of queries, comprising: determining, at a database driver, whether a first query and a second query are similar, the first query being sent from a first execution thread executing in an application server, wherein the first and second queries are similar if the first and second queries include a set of common database tables from which to select data; and in response to a determination that the first and second queries are similar: determining a distinct set of conditions included in a conditions clause in the first and second queries; generating, at the database driver, a union query based on the first and second queries, wherein the union query includes the set of common database tables and each condition of the distinct set of conditions; submitting the union query to a database that stores the set of common database tables from which data is selected based on the first and second queries; receiving a combined result set of the union query from the database; submitting the first query against the combined result set; and receiving, at the database driver, a first result set of the first query in response to submitting the first query against the combined result set. 10. The method of claim 1 , further including: receiving the first query; receiving the second query from a second execution thread executing in the application server; if the first and second queries are not received within a time interval, submitting the first and second queries to the database; and in response to a determination that the first and second queries are not similar, submitting the first and second queries to the database, wherein determining whether the first query and the second query are similar includes determining, at the database driver, whether the first and second queries are similar if the first and second queries are received within the time interval.