Question: What statements about the following method are correct? (Choose three.) A. It protects against a denial of service attack. B. It does not protect against

What statements about the following method are correct? (Choose three.) 

public String findWaffles (String connectionStr, String search) throws SQLException { var query

A. It protects against a denial of service attack.

B. It does not protect against denial of service attacks.

C. It protects against SQL injection because it uses a PreparedStatement.

D. It does not protect against SQL injection.

E. Assuming the database and related table exist and are available, this mode is expected to run without any exceptions being thrown.

F. This method will always produce an exception at runtime.

public String findWaffles (String connectionStr, String search) throws SQLException { var query = "SELECT * FROM meal WHERE type='"+search+"'"; var con = DriverManager.getConnection (connectionStr); try (con; }} var ps = con.prepareStatement (query); var rs = ps.executeQuery()) { return rs.getString("name");

Step by Step Solution

3.43 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer The correct statements about the given method are C It protects against SQL injectio... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!