1. A method of processing a plurality of queries, comprising: determining, at a database driver, that a first query and a second query are similar, the first query being sent from a first execution thread executing in an application server; generating, at the database driver, a union query based on the first and second queries; submitting the union query to a database that stores 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.