为Java项目创建安装 [英] Creating an installation for a java project

查看:148
本文介绍了为Java项目创建安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个使用数据库来检索,编辑和保存数据的java项目。我使用Netbeans完成了项目,现在我想从项目中创建一个安装。为此,我想包括要与项目一起安装的数据库。
我用来连接数据库的代码是:

I created a java project that uses a database to retrieve, edit, and save data. I finished the project using Netbeans and now I want to create an installation out of the project. To do so, I want to include the database to be installed along with the project. The code I am using to connect to the database is:

Class.forName("com.mysql.jdbc.Driver");
String connectionUrl = "jdbc:mysql://localhost/mysql?" + "user=root&password=123";
Connection con = DriverManager.getConnection(connectionUrl);

应用程序在我的电脑上工作正常,但是我需要将它作为可执行文件安装在其他电脑上pcs。

The application is working fine on my pc, but I need it to be installed as an executable on other pcs.

最好的方法是什么?

推荐答案

MySQL是一个完整的数据库管理工具,不适合嵌入式客户端使用。请查看h2内存数据库。

MySQL is a whole database management tool and not suited for an embedded client use. Take a look in the h2 memory database instead.

如果你仍想继续你的路径,我会用你的programm和一个mysql安装执行程序创建一个存档。在您的存档中有一个安装脚本/执行,它在客户端的计算机上安装和配置mysql。你想让它成为一个静默安装,即将有向导,所有配置都是从你的安装skript完成的。

If you still want to proceed in your path, I would create a archive with your programm and a mysql installation executive. Inside your archive there is a setup script/execute which installs and configures mysql on the client's computer. You want to make it a silent install i.e. there will be wizard and all configuration is done from your installation skript.

这篇关于为Java项目创建安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆