Patent ID: 7174326

Claim:
A method for executing a database statement, the method comprising: preparing at least one template capable of generating an executable statement for execution against a database via a particular database connection; storing the at least one template in a shared cache at an application server so that the at least one template is available to a plurality of database connections, such that memory requirements of the shared cache are proportional to how many templates exist, regardless of how many executable statements are generated; in response to a request to execute a particular statement on a given database connection, determining whether a first template for the particular statement is available in the shared cache; if the first template is unavailable in the shared cache, preparing a second template for execution of the particular statement against the database and placing the second template in the shared cache; once the first template is available in the shared cache, creating a corresponding executable statement based on the first template, the executable statement having been prepared for execution on the given database connection; executing the executable statement on the given database connection and returning any results of executing the executable statement.