You can not connect to a database using only JavaScript and you should never show your database values in JavaScript as everybody can read them.
You have to use a server side script to connect to your database, resolving the autocomplete values and responding them to the autocomplete plugin.
So in gerenal you don't use a local "source" with the suggestions, but a server side script and getting the values through ajax calls:
$("#tags").autocomplete('url_to_server_side_script');
EDIT: So i looks like it is a JSP page. After getting the values wihtin the function, you have to create an output (and use the "reponse" to send it to the client) with each value in a new line looking like this:
ActionScript
AppleScript
Scheme
You can even use HTML to markup the match of the query string (let's asume it was "Sc"):
Action<em>Sc</em>ript
Apple<em>Sc</em>ript
<em>Sc</em>heme