【发布时间】:2016-07-01 10:39:54
【问题描述】:
所以现在我有一个通过 JDBC 使用 swing 和 Mysql 数据库创建的工作应用程序。所以我看到客户端-服务器设置的方式是我将 .exe 包装的 swing 项目放在 PC1(服务器 pc)上。那么它可能有 2 台或更多客户端 PC 的 PC2(客户端)和 PC3(客户端),所有这 3 台 PC 都通过 LAN 连接。
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 connector、mysql workbench、xampp。
我只剩下6-7个月的时间了,所以如果需要学习socket或网络编程,我会从0%的知识开始学习。我担心如果它很复杂,时间可能不够。
我读过一些我不知道的关于 RMI 的文章。不知道是不是和我的问题有关。
这个问题可能很长,但我想不出更短的方式来解释它,因为我猜客户端-服务器设置在 Java 中很广泛,因为它适用于其他 Web 服务。
如果我有任何建议或解释,我将不胜感激,但我更喜欢详细的,因为我的知识有限。
提前致谢。
补充一点,我在某处读到,也许我需要的只是将 Java Web 服务与 Swing 应用程序一起使用。有什么想法或建议吗?
【问题讨论】:
-
只有知道这些外部系统的接口是什么,您才知道要研究什么。提出问题就知道了,你不能用代码解决它,直到你这样做。
-
虽然我认为在某些方面这是一个很好的问题,但我也认为它对于 StackOverflow 来说有点过于宽泛,但希望有人能够为您指出一些有关该主题的教程或指南。也许你会得到this topic的积极回应
-
@Gimby 谢谢。实际上客户没有很多电脑。据我估计,只有大约 5 台计算机可以使用我们正在开发的系统。所以他们可能只会使用普通的交换机或路由器。我只需要知道如何在 Java 中做到这一点。我很感激任何建议。有没有特定的包可以使用?再次感谢。
-
@Martin 感谢您的链接。
-
听起来客户端想要一个客户端-服务器应用程序。除非您需要开发一些严肃的应用程序协议,否则没有真正需要直接涉及套接字。各种图书馆将负责这一点。尽管如此,您的问题非常广泛,因此我投票关闭它。
标签: java swing sockets networking jdbc