简体   繁体   English

Java FX和数据库连接

[英]Java FX and Database Connection

I want to write a JavaFX program with Database Connection(MYSQL). 我想用数据库连接(MYSQL)编写一个JavaFX程序。 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?! (可能是由于版本差异或某些原因。)任何人都可以给出建立连接的过程,并从程序中查询JavaFX的最新版本吗?

Thanks. 谢谢。

Naren 那仁

我也建议您看看DataFX

User interfaces should not be connecting directly to a database. 用户界面不应直接连接到数据库。

Put a servlet in-between to act as an intermediary. 在其间放置一个servlet以充当中介。 Let it do security, validation, binding, and such, too. 让它也执行安全性,验证,绑定等等。

You're finding it hard because you shouldn't. 您会发现很难,因为您不应该这样做。

You can see my post in javamexico.org , where I talk about connecting mysql with java and javafx. 您可以在javamexico.org上看到我的帖子,在那儿我谈到了将mysql与java和javafx连接。 it´s written in spanish but just look at the code. 它是用西班牙语编写的,但只需看一下代码即可。 http://javamexico.org/foros/java_enterprise/tratamiento_de_imagenes#comment-3738 http://javamexico.org/foros/java_enterprise/tratamiento_de_imagenes#comment-3738

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

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