Java Practice Test – 3 Posted by Editor Date 2022-09-28 Comments 0 comment Welcome to your Java Practice Test - 3 Which type of Statement can execute parameterized queries? A. PreparedStatement B. ParameterizedStatement C. ParameterizedStatement and CallableStatement D. All kinds of Statements (i.e. which implement a sub interface of Statement) nWhich of the following is true about 'dirty read'? A - In typical database transactions, say one transaction reads and changes the value while the second transaction reads the value before committing or rolling back by the first transaction. This reading process is called as 'dirty read'. B - There is always a chance that the first transaction might rollback the change which causes the second transaction reads an invalid value. C - Both of the above. D - None of the above. What happens if you call deleteRow() on a ResultSet object? . The row you are positioned on is deleted from the ResultSet, but not from the database B. The row you are positioned on is deleted from the ResultSet and from the database C. The result depends on whether the property synchronizeWithDataSource is set to true or false D. You will get a compile error: the method does not exist because you cannot delete rows from a ResultSet ) Which of the following is not a JDBC connection isolation levels? a) TRANSACTION_NONE b) TRANSACTION_READ_COMMITTED c) TRANSACTION_REPEATABLE_READ d) TRANSACTION_NONREPEATABLE_READ In order to transfer data between a database and an application written in the Java programming language, the JDBC API provides which of these methods? a. Methods on the ResultSet class for retrieving SQL SELECT results as Java types. b. Methods on the PreparedStatement class for sending Java types as SQL statement parameters. c. Methods on the CallableStatement class for retrieving SQL OUT parameters as Java types. d. All mentioned above The intent is for JDBC drivers to implement nonscrollable result sets using the support provided by the underlying database systems. a. True b. False In which of the following type of ResultSet, the cursor can only move forward in the result set? A - ResultSet.TYPE_FORWARD_ONLY B - ResultSet.TYPE_SCROLL_INSENSITIVE C - ResultSet.TYPE_SCROLL_SENSITIVE D - None of the above. Which of the following is used to call a stored procedure? A. Statement B. PreparedStatement C. CallableStatment D. CalledStatement Which of the following encapsulates an SQL statement which is passed to the database to be parsed, compiled, planned and executed? A. DriverManager B. JDBC driver C. Connection D. Statement Which of the following is an advantage of using PreparedStatement in Java? A. Slow performance B. Encourages SQL injection C. Prevents SQL injection D. More memory usage Time is Up! Time's up Share: Editor Previous post UI Technologies Practice Test - 2 2022-09-28 Next post UI Technologies Practice Test - 3 2022-09-28 You may also like Oracle Tutorial Videos 8 April, 2023 Spring Tutorial Videos 8 April, 2023 Ui Technologies Tutorial Videos 1 April, 2023