Java FX 和数据库连接
我想用数据库连接(MYSQL)编写一个JavaFX程序。我不知道如何在程序中创建连接。而且我在互联网上找到的方法对我来说不起作用。 (可能是因为版本差异或其他原因。)任何人都可以提供建立连接并从程序运行查询以获得最新版本的 JavaFX 的过程吗?!
谢谢。
纳伦
I want to write a JavaFX program with Database Connection(MYSQL). I did not know how to create a connection in program. And the methods I found on internet is not working for me. (Possibly because of the version difference or something.) Can anyone give the procedure to establish a connection and run a query from the program for the latest version of JavaFX?!
Thanks.
Naren
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我还建议看看 DataFX
I would also suggest taking a look at DataFX
用户界面不应直接连接到数据库。
在两者之间放置一个 servlet 以充当中介。让它也执行安全、验证、绑定等操作。
你会发现这很难,因为你不应该这样做。
User interfaces should not be connecting directly to a database.
Put a servlet in-between to act as an intermediary. Let it do security, validation, binding, and such, too.
You're finding it hard because you shouldn't.
你可以在 javamexico.org 中看到我的帖子,其中我谈论了将 mysql 与 java 和 javafx 连接。它是用西班牙语编写的,但只需看看代码即可。
http://javamexico.org/foros/java_enterprise/tratamiento_de_imagenes#comment-3738
You can see my post in javamexico.org, where I talk about connecting mysql with java and javafx. it´s written in spanish but just look at the code.
http://javamexico.org/foros/java_enterprise/tratamiento_de_imagenes#comment-3738