Return to site

☕🎓JAVA CERTIFICATION QUESTION: Prepared statements

· java,ocp

Which is true? (Choose two)

* executeQuery() executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

* executeUpdate() executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

* executeQuery() executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

* executeUpdate()executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

#java #certificationquestion #ocp

https://www.udemy.com/course/ocp-oracle-certified-professional-java-developer-prep/?referralCode=54114F9AD41F127CB99A

Answer:

executeQuery()

Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

executeUpdate()

Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.