but i dont need a servlet, i just need to know how aIt would not be ideal in any way. Try it and you would find very soon how some people will fry your applet and shut down your database within a couple of hours after creating your applet. Plus most people cannot do anything with your applet because setting the policy and installing the needed jdbc drivers is too complicated for 90% of your users.
java applet can connect to a mysql database
usually, php would do it
something ideal would be a static method, something