Can JavaScript connect with MySQL? If so, how?
Depending on your environment, you could use Rhino to do this, see Rhino website. This gives you access to all of the Java libraries from within JavaScript.