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類別。