简体   繁体   English

部署Java / MySQL应用程序

[英]deploy a java/mysql application

I created a java swing application using a MySQL database. 我使用MySQL数据库创建了Java swing应用程序。 So I want to create an installer for the application so as it could be installed and runned on every pc having JRE installed. 因此,我想为该应用程序创建一个安装程序,以便可以在安装了JRE的每台PC上安装和运行该安装程序。

After some researches, I found a way to achieve this using Launch4j and Inno Setup Compiler after generating the jar file. 经过一些研究,我找到了生成jar文件后使用Launch4j和Inno Setup Compiler实现此目的的方法。

The problem is that I don't know how to integrate the mysql database so as the application can be seen as a whole. 问题是我不知道如何集成mysql数据库,因此应用程序可以看作一个整体。

Thanks in advance 提前致谢

It is more a comment that anything, but I need the extra space/formatting: 更多的是评论,但是我需要额外的空间/格式:

A MySQL install is not something I would do automatically for a user because: 我不会为用户自动执行MySQL安装,因为:

a) You are creating services that the user may not know how to manage. a)您正在创建用户可能不知道如何管理的服务。 You are installing a program that will open ports, that may need security updates, etc. If your final user has no IT background to properly manage that, it is clearly a security issue. 您正在安装将打开端口的程序,可能需要安全更新等。如果最终用户没有IT后台来妥善管理该端口,那么显然这是一个安全问题。

b) Maybe the user prefers another configuration. b)也许用户喜欢其他配置。 OTOH, if the user knows what he is doing, maybe he already has a MySQL install. OTOH,如果用户知道自己在做什么,那么也许他已经安装了MySQL。 He may prefer just to run your DB inside the MySQL that is already installed, because it is properly configured (including backups), it is in redundant hardware, whatever. 他可能更喜欢仅在已安装的MySQL内部运行数据库,因为它已正确配置(包括备份),并且位于冗余硬件中,无论如何。

If you need a small, embedded database with your product, switch to Derby or Hypersonic. 如果您的产品需要小型的嵌入式数据库,请切换到Derby或Hypersonic。

If your product requires a full MySQL install, just provide (and document) a way for an IT operator do the installation by itself (give the SQL scripts to create and populate the database together with the code, specify how to configure the DB parameters in your application). 如果您的产品需要完整的MySQL安装,只需为IT操作员提供一种(和提供文件说明)自行完成安装的方法(提供SQL脚本以创建和填充数据库以及代码,请指定如何在中配置DB参数)。你的申请)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM