1Z0-809 practice question 17 of 25

Given the structure of the STUDENT table: Student (id INTEGER, name VARCHAR) Given: public class Test { static Connection newConnection =null; public…

Choose your answer, then check it against the explanation.

Given the structure of the STUDENT table: Student (id INTEGER, name VARCHAR) Given: public class Test { static Connection newConnection =null; public static Connection get DBConnection () throws SQLException { try (Connection con = DriveManager.getConnection(URL, username, password)) { newConnection = con; } return newConnection; } public static void main (String [] args) throws SQLException { get DBConnection (); Statement st = newConnection.createStatement(); st.executeUpdate(“INSERT INTO student VALUES (102, ‘Kelvin’)”); } } Assume that: The required database driver is configured in the classpath. The appropriate database is accessible with the URL, userName, and passWord exists. The SQL query is valid. What is the result?
Answer options
Question 17 of 25

Keep practicing

Take the free 1Z0-809 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other 1Z0-809 practice questions

Scroll to Top