Java Question 1 Which of the following statements is FALSE given that your Java
ID: 3868048 • Letter: J
Question
Java
Question 1
Which of the following statements is FALSE given that your Java program is accessing a MySQL database?
Question 2
This SQL keyword is used to add a row to a table.
Question 3
To catch an exception, the code that might cause the exception must be enclosed in a
Question 4
Which statement below is FALSE?
Question 5
Which of the following statement is FALSE?
If the database is not available, the program will have a runtime error when attempting to create a connection object.Explanation / Answer
Answer 1.
The statement “If the driver for MySQL is not in the class path, the program will have a syntax error” is false.
In this case if the driver for MySQL is not in the class path, it will give ClassNotFoundException.
Thus, the option 3 is false.
Answer 2.
The SQL keyword that is used to add a row to a table is INSERT.
The CREATE command in SQL is used to create a new table.
The UPDATE command in SQL is used to modify the table.
The INSERT command in SQL is used to add new rows of data in the table.
Thus, the option 3 is correct.
Answer 3.
To catch an exception, the code that might cause the exception must be enclosed in a try block.
In case of a checked exception, it can be handled using try-catch block. The throws keyword is used to specify the exceptions that a particular method can throw.
Thus, the option 2 is correct.
Answer 4.
The statement “ResultSet row and column numbers start at 0” is false
The option 3 is false.
Answer 5.
The statement “The finally block and try block can appear in any order” is false because there is a specific order of execution of the try-catch and finally blocks. The body of try is executed first. If an exception is thrown, the appropriate catch clause is executed. The finally block is executed at the end.
The option 3 is false.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.