0
我正在使用JSP,我想通过我的Java文件连接到本地mySQL数据库。连接到Wampserver数据库
我有这样的:
连接连接=的DriverManager.getConnection((database_path), “管理员”, “管理员”);
路径是什么?
我正在使用JSP,我想通过我的Java文件连接到本地mySQL数据库。连接到Wampserver数据库
我有这样的:
连接连接=的DriverManager.getConnection((database_path), “管理员”, “管理员”);
路径是什么?
这些设置在this example中有很好的解释。
String connectionURL = "jdbc:mysql://localhost:3306/usermaster";
...
Connection connection = DriverManager.getConnection(connectionURL, "root", "root");
由于链接经常中断,所以发布相关代码的小代码以及:) – Leigh 2012-02-19 20:04:31
啊!我看到......这是我的第一个答案。谢谢你的方式! – Ikoy 2012-02-20 23:30:44
没问题。欢迎来到stackoverflow,btw :) – Leigh 2012-02-21 00:18:37