7. The computer-readable storage medium of claim 6 , wherein the mismatch alert throws an error.
6. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for using query signatures to detect SQL injection, wherein the computer-readable storage medium includes magnetic and optical storage devices, disk drives, magnetic tape, CDs (compact discs), and DYDs (digital versatile discs or digital video discs), the method comprising: initializing a signature cache, wherein initializing the signature cache involves: trapping database queries in a controlled environment, parsing the database queries to produce a set of valid signatures, wherein parsing the database queries involves determining retaining SQL keywords contained in each query, and removing field names and corresponding values in each query, to determine the signature for each query; wherein the signature for a query contains the text of SQL keywords and operands without any field name or value in the query, and storing the valid signatures in the signature cache; receiving a query at the database; parsing the query at the database to determine a signature for the query, wherein the signature comprises SQL keywords contained in the corresponding query with literals removed; determining if the signature is located in the signature cache, which contains signatures for valid queries; and if so, allowing the corresponding SQL query to proceed, otherwise, triggering a mismatch alert.