我正在使用 JSP,我想通过我的 Java 文件连接到本地 mySQL 数据库。
我有这个:
连接connection = DriverManager.getConnection((database_path),"admin","admin");
路径应该是什么?
最佳答案
这些设置在this example中有很好的解释。 .
String connectionURL = "jdbc:mysql://localhost:3306/usermaster";
...
Connection connection = DriverManager.getConnection(connectionURL, "root", "root");
关于mysql - 连接到 Wampserver 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9350511/