views:

219

answers:

2

I have created a java letter game applet using netbeans 6.0 which also has a Microsoft Access Database for the High Scores. I want to upload it into a webpage (like how its done on miniclip facebook etc) I'd like to know how it could be done

+2  A: 

I'm not sure what you mean with "upload it into a webpage". Applets are embedded into webpages using the <applet> tag or the <object> tag. However, the Access DB could become a problem, since it is poorly suited to an internet app with potentially many concurrent users.

Additionally, accessing a DB directly from an applet is a very bad idea, since the applet code (which is globally accessible to everyone) will need to contain the DB user and password, which means that everyone who bothers to decompile the applet can do whatever they want (and that user is allowed) to do with the DB. At the very least, they'll be able to enter fairy tale highscores (e.g. 50 million when a perfect game gets you 1000).

Michael Borgwardt
Minor note: <applet> is technically a deprecated tag. While <applet> is simpler to use, it would probably be better to recommend using the <object> tag (http://www.w3schools.com/TAGS/tag_object.asp).
htw
A: 

As Michal Borgwardt said, in order to put the actual applet on your page you upload the compiled class file and then use an applet or object tag.

For high scores, you need to use a database on your web server (such as MySQL) and write a page that interfaces it using PHP or ASP or your other web language of choice. You would then have the applet open the specified page, giving it POST parameters of the player's name, score, etc. Also, since things like that can be spoofed, you need to figure out a way to prevent people from just opening the page themselves with bogus name and score entries.

Ricket