Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » Can a JavaFX program run in JWS and access a database?
Can a JavaFX program run in JWS and access a database? [message #1726849] Wed, 16 March 2016 21:27 Go to next message
Eclipse UserFriend
I am starting to design an application that ideally would have its GUI written in JavaFX, would run in a JWS (Java Web Start) environment and read and write from a relational database, either DB2 or MySQL.

Before I spend a lot of time on the design, I'd just like to verify that this combination is possible.

If anyone has a simple program with all or most of those features that they'd be willing to share for me to use as a starting point, I'd really appreciate it. Otherwise, I'll do that myself. If I write a program that uses JavaFX to display a button on a stage and pressing the button executes a trivial query, like "what is the current date?" on a DB2 or MySQL database, that should prove that the concept is viable. If the prototype can also write a trivial record to a database, such as a single row to an empty table, that would be even better.
Re: Can a JavaFX program run in JWS and access a database? [message #1726852 is a reply to message #1726849] Wed, 16 March 2016 21:59 Go to previous messageGo to next message
Eclipse UserFriend
It shouldn't be any different from any other Java Web Start application. You can web start an application with JavaFX as long as the user has an appropriate version of Java installed. You will most likely need to sign your jars and jnlp file to make it work.

Keep in mind that e(fx)clipse supports both standard Java applications as well as OSGi applications. It is possible to use OSGi with JavaFX, but it is very difficult. You will be much better off using standard Java.
Re: Can a JavaFX program run in JWS and access a database? [message #1726885 is a reply to message #1726849] Thu, 17 March 2016 05:39 Go to previous messageGo to next message
Eclipse UserFriend
a) it should be possible
b) I would not implement it this way because then your user has a
physical db connection and could issue DELETE FROM tbl, ... .

Tom

On 17.03.16 02:27, Reinhardt Christiansen wrote:
> I am starting to design an application that ideally would have its GUI
> written in JavaFX, would run in a JWS (Java Web Start) environment and
> read and write from a relational database, either DB2 or MySQL.
> Before I spend a lot of time on the design, I'd just like to verify that
> this combination is possible.
> If anyone has a simple program with all or most of those features that
> they'd be willing to share for me to use as a starting point, I'd really
> appreciate it. Otherwise, I'll do that myself. If I write a program that
> uses JavaFX to display a button on a stage and pressing the button
> executes a trivial query, like "what is the current date?" on a DB2 or
> MySQL database, that should prove that the concept is viable. If the
> prototype can also write a trivial record to a database, such as a
> single row to an empty table, that would be even better.
Re: Can a JavaFX program run in JWS and access a database? [message #1726887 is a reply to message #1726885] Thu, 17 March 2016 05:42 Go to previous messageGo to next message
Eclipse UserFriend
One more note: Oracle suggest to use the java-packager and ship a
private JRE with it!

Tom

On 17.03.16 10:39, Tom Schindl wrote:
> a) it should be possible
> b) I would not implement it this way because then your user has a
> physical db connection and could issue DELETE FROM tbl, ... .
>
> Tom
>
> On 17.03.16 02:27, Reinhardt Christiansen wrote:
>> I am starting to design an application that ideally would have its GUI
>> written in JavaFX, would run in a JWS (Java Web Start) environment and
>> read and write from a relational database, either DB2 or MySQL.
>> Before I spend a lot of time on the design, I'd just like to verify that
>> this combination is possible.
>> If anyone has a simple program with all or most of those features that
>> they'd be willing to share for me to use as a starting point, I'd really
>> appreciate it. Otherwise, I'll do that myself. If I write a program that
>> uses JavaFX to display a button on a stage and pressing the button
>> executes a trivial query, like "what is the current date?" on a DB2 or
>> MySQL database, that should prove that the concept is viable. If the
>> prototype can also write a trivial record to a database, such as a
>> single row to an empty table, that would be even better.
>
Re: Can a JavaFX program run in JWS and access a database? [message #1726972 is a reply to message #1726885] Thu, 17 March 2016 16:59 Go to previous messageGo to next message
Eclipse UserFriend
How could they do a "Delete from <table>" if I have coded the SQL right in the code? I'm not going to give them a command prompt so that they can write any SQL they want.

Does JavaFX/JWS provide an opportunity for SQL injection that I don't know about?
Re: Can a JavaFX program run in JWS and access a database? [message #1726973 is a reply to message #1726852] Thu, 17 March 2016 17:01 Go to previous messageGo to next message
Eclipse UserFriend
I think I'll stick to standard Java. In truth, I've never used OSGi. I'm not even sure what it is, although I could obviously google it as easily as the next guy.
Re: Can a JavaFX program run in JWS and access a database? [message #1726978 is a reply to message #1726972] Thu, 17 March 2016 18:44 Go to previous message
Eclipse UserFriend
You have a physical DB-connection which one can intercept and execute
any SQL statement he/she wants, and naturally your DB-Server needs to
allow connections from any host on earth, any sense DB-Admin will not
allow that.

So its just bad application design in 2016 to make your client app
directly writing to your DB, you better provide a REST-API on the server
and your client talks to that.

Tom

On 17.03.16 21:59, Reinhardt Christiansen wrote:
> How could they do a "Delete from <table>" if I have coded the SQL right
> in the code? I'm not going to give them a command prompt so that they
> can write any SQL they want.
> Does JavaFX/JWS provide an opportunity for SQL injection that I don't
> know about?
Previous Topic:Installing Scenebuilder?
Next Topic:FXML include didn't bring the css along
Goto Forum:
  


Current Time: Wed Jul 23 06:27:13 EDT 2025

Powered by FUDForum. Page generated in 0.05021 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top