以下是連接到MySQL數據庫在JDBC使用Class.forName
// This will load the MySQL driver, each DB has its own driver
Class.forName("com.mysql.jdbc.Driver");
// Setup the connection with the DB
connect = DriverManager
.getConnection("jdbc:mysql://localhost/feedback?"
+ "user=sqluser&password=sqluserpw");
我正在學習用Java反射在哪裏可以使用 的Class.forName()
Class c = Class.forName("java.awt.Button");
獲得類的代碼
是使用的語法。
我的問題是爲什麼MySQL ForName不需要被變量捕獲?
你是什麼意思_did不需要被捕獲Class_? –