http://motionsharing.com/site/download/acefad55f1e81e456d71a7448b278915無法從Eclipse的數據源資源管理器
連接到MySQL數據庫無法從Eclipse的數據源資源管理器連接到MySQL數據庫。
我調整合適的驅動程序,但我無法連接。 P.S .:我可以連接到德比數據庫,我可以連接到MySQL數據庫,但只能從代碼,但我想從數據源資源管理器連接到MySQL數據庫,以獲得posivbilities來創建表等。
出了什麼問題?
我可以通過代碼連接。
public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Driver loading success!");
String url = "jdbc:mysql://localhost:3306/mydb";
String name = "root";
String password = "root";
try {
Connection con = DriverManager.getConnection(url, name, password);
System.out.println("Connected.");
con.close();
System.out.println("Disconnected.");
} catch (SQLException e) {
e.printStackTrace();
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
但是什麼是然後com.mysql.jdbc.Driver? – ASD 2012-02-23 21:07:05
這是一個連接到MySQL數據庫的庫。如果你從我發佈的鏈接下載,你會發現它。 – adarshr 2012-02-23 21:09:01