13. A method for detecting a structured query language (SQL) injection attack, the method performed by a computer executing computer-readable code embodied on a computer-readable storage device, the method comprising the steps of: a) in a training phase: i. generating, by the computer, a plurality of n-gram distributions of SQL token domain queries, ii. computing an averaging vector, iii. calculating a respective inner product of each n-gram distribution with a random vector, and iv. based on the inner products, determining a threshold; and b) in a detection phase: i. transforming, by the computer, a new SQL query into a new SQL token domain query, and ii. applying a n-gram analysis together with the threshold and the averaging vector to the new SQL token domain query to determine whether or not the new SQL domain query is an injection attack query.
13. A method for detecting a structured query language (SQL) injection attack, the method performed by a computer executing computer-readable code embodied on a computer-readable storage device, the method comprising the steps of: a) in a training phase: i. generating, by the computer, a plurality of n-gram distributions of SQL token domain queries, ii. computing an averaging vector, iii. calculating a respective inner product of each n-gram distribution with a random vector, and iv. based on the inner products, determining a threshold; and b) in a detection phase: i. transforming, by the computer, a new SQL query into a new SQL token domain query, and ii. applying a n-gram analysis together with the threshold and the averaging vector to the new SQL token domain query to determine whether or not the new SQL domain query is an injection attack query. 18. The method of claim 13 , wherein the random vector is a Gaussian random vector.