Help - Search - Members - Calendar
Full Version: Using Java With Mysql On Zymic
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
Fguy
greetings I have an ongoing project, a java applet, that I am hosting on uuuq. I's like to establish communications between the applet and mySQL.

It's simple enough to use php to query data from mySQL and pass it on to the java applet when the applet is first loaded, and I have done so. What I'd really like is for my applet (client side java) to send data back to mySQL, perhaps using php or html as an intermediary.

My initial research suggests this is very difficult or even impossible to do using the free service that zymic offers. Some more advanced server side programmibng is required.

any comments?
swordz
Use AJAX or equivalent to call a PHP script.

swordz
Fguy
QUOTE(swordz @ Aug 26 2009, 06:29 PM) *
Use AJAX or equivalent to call a PHP script.

swordz


Hmm, I've heard of Ajax, but I know little about it. Thanks for the tip, I'll check it out.
Fguy
Anyways, I finally got around to implementing this, so I thought I'd post my eventual solution.

I was able to use java libraries to get the job done, e.g. you can use the URLConnection class and the URL class to open a connection to a URL, in this case a php script in my home directory structure. Then simulate an HTTP POST request by writing a specially constructed string to the URL connection. Once php gets the data it's a done deal to get it to mySQL.

If anyone would like the details of how this is done, let me know.

It was nice to be able to do this with the zymic free service without having to resort to server side java. I understand it's also possible to package some Apache Client libraries with java jar files which is even easier.

I suppose if I was using javascript as opposed to java, then AJAX would be the way to go.

regards.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.