Question: Which statement best describes the following method? A. It is not susceptible to any common attacks. B. It is at risk of SQL injection attack
Which statement best describes the following method?

A. It is not susceptible to any common attacks.
B. It is at risk of SQL injection attack only.
C. It is at risk of a denial of service attack only.
D. It is at risk of both SQL injection and denial of service attacks.
E. The method does not compile.
F. None of the above.
public String find NewLego (String url, int type) throws SQLException { var query = "SELECT name FROM sets WHERE " } + "type = " + type " ORDER BY date DESC"; var con = Driver Manager.getConnection (url); var ps = con.createStatement (); try (con; ps; var rs = ps.executeQuery (query)) { if(rs.next()) return rs.getString (1); } throw new RuntimeException ("None available, try later");
Step by Step Solution
3.46 Rating (146 Votes )
There are 3 Steps involved in it
The Java method in the provided image appears to perform a query on a database to find a new Lego se... View full answer
Get step-by-step solutions from verified subject matter experts
