因此,现在我有一个通过JDBC使用swing和Mysql数据库创建的工作应用程序。因此,我看到客户机-服务器设置的方式是,我将.exe包装的swing项目放在PC1(服务器pc)上。然后,它可以具有2台或更多台客户端PC的PC2(客户端)和PC3(客户端),其中所有这3台PC都通过局域网连接。
What should I do to embed the MySql database that my swing application is using so that if I wrap the java swing project to .exe, the database will be embedded together with the exe/installer? What's the best tool to use given the specifications?
If first question is possible and let's assume that the swing app and mysql database are wrapped together and is residing on PC1(server pc), what do i do next so that the copy of swing application on PC2(client) and PC3(client) can talk to PC1 (server)?
Can I accomplish the client-server setup I want without any network or socket programming? (my professors who are non-java programmers said that on other programming languages such as C# that you only need the IP address which im clueless about).问题:我的知识仅限于JDBC、Java Swing和Mysql。工具有Netbeans,mysql j连接器,mysql工作台,xampp。
我只剩下6-7个月的时间来做这件事,所以如果需要学习套接字或网络编程,我会从0%的知识开始学习。如果它很复杂,我担心时间可能不够。
我读过一些我不知道的关于RMI的东西。不知道是不是跟我的问题有关。
这个问题可能很长,但我想不出一种更短的方式来解释它,因为我猜客户机-服务器设置在Java中是广泛的,因为它适用于其他way服务。
我很感谢任何建议或解释,但我更喜欢一个详细的,因为我的知识有限。
提前谢谢。
另外,我在某处读到,也许我所需要的就是在Swing应用程序中使用Java Web服务。有什么想法或建议吗?
发布于 2016-07-14 21:10:46
您可以:
<代码>H19使用RMI客户端API编写您的swing客户端。<代码>H210<代码>F211
然后,您可以:
发布于 2016-07-20 21:36:42
我认为有帮助的一种方法是,由于这是一个swing应用程序,您可以将其作为applet,并使用简单的应用程序服务器(如tomcat )来部署它。上面有很多像this one这样的教程。
现在谈到数据库端,您可以通过将mysql打包为压缩文件,将mysql安装在其中一台机器(PC1)上,并且您的applet可以从任何机器连接到它。您不必在所有机器上安装数据库,因为您只需要安装的机器的IP、数据库名称、模式、用户in、用于JDBC连接的密码。
通过这种方式,我相信您可以将现有应用程序转换为客户端-服务器应用程序。希望这能有所帮助。
https://stackoverflow.com/questions/38143306
复制相似问题