Which statement is true about the DriverManager class?

A. It returns an instance of Connection.
B. It executes SQL statements against the database.
C. It only queries metadata of the database.
D. It is written by different vendors for their specific database.

題解

選項 A,使用 DriverManager 類別的 getConnection,可以連接資料庫並取得 Connection 物件實體。

選項 B,Statement 物件才可以執行 SQL 敘述。

選項 C,DriverManager 是用來載入 JDBC 的 Driver 和連接資料庫。

選項 D,這個敘述描述的應是 Driver 類別。