Technically you could do this - but it would be highly unsupported and not recommended Look into using an ADODB.Connection with JavaScript. If you are looking to update something in the CRM database you should use a supported method.
Sample: Create, Retrieve, Update and Delete Using the REST Endpoint with JavaScript
If the table is not in CRM, a better option would be to create and expose a web service that can be accessed via your JavaScript.