Tim
Tim

Reputation: 1074

Java Applet - Possible to insert data into a MySQL database?

So I have a JApplet that was originally a stand alone program. In order to extend it I've converted it into a JApplet.

What I now want to do is everytime data is submitted to the JApplet I would like the contents inserted into a MySQL database. Now, I have no idea how to do this or even if it can be done but I'd like to give it a go!

The idea is that I'll have a separate PHP page to display data inserted into the JApplet form.

Any solutions, comments or pointers would be very handy as I haven't done this before!

Upvotes: 0

Views: 687

Answers (1)

favoretti
favoretti

Reputation: 30187

From what I understand of the whole concept, Applets are client-side executables. So basically if your applet will establish communication with the server (preferably not a direct MySQL connection, but via REST API or other sort of client-server comms) you can insert the data. Otherwise, to address your MySQL database directly from your Java code - you can convert your program to be a servlet and run it in an application container on the server.

Upvotes: 2

Related Questions