Multiple choice

With reference to JDBC, arrange the following steps in ascending order:

  1. Create Statement 2. Execute Query 3. Get Connection 4. Register Driver

  1. 3, 4, 1, 2

  2. 4, 3, 1, 2

  3. 3, 4, 2, 1

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The correct JDBC sequence is: 1) Register Driver, 2) Get Connection, 3) Create Statement, 4) Execute Query. First, you register the JDBC driver, then establish a connection to the database, create a statement object, and finally execute the SQL query.