连接到用户计算机上的数据库

时间:2015-05-01 19:13:28

标签: java mysql database-connection netbeans-8

我目前正在使用Netbeans 8并试图让MySQL数据库连接到程序而无需将MySQL下载到用户计算机或运行服务器,因此MySQL文件必须是本地的。我如何进行是否有办法打包程序的jar或我应该采取另一种方式。

此处还有连接数据库的代码。

Class.forName("com.mysql.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/chutesandladders", name, password);
            Statement update = conn.createStatement();

0 个答案:

没有答案
相关问题