hi ...
you cannot do that with standard-javascript - may be there are some IE-proprietary ActiveX-objs. out there ... but besides that, you have to do that on serverside. You may consider AJAX, that makes XMLHttpRequests in the background that are called by JavaScript ... and you get a more responsive application through that ... but even with that you have to call a serverside script or service or whatever to get connected with a database ...
kind regards