ASD*_*ASD 3 java eclipse jdbc java-ee
http://motionsharing.com/site/download/acefad55f1e81e456d71a7448b278915
无法从Eclipse DataSource Explorer连接到MySQl数据库.
我调整适当的驱动程序,但我无法连接.PS:我可以连接到derby db,我可以连接到mysql db但只能从代码连接,但是我想从Data Source Explorer连接到mysql db以获得创建表的可能性等等.
怎么了 ?
我可以通过代码连接.
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();
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9452 次 |
| 最近记录: |