Failed to connect SQL database through Java scripts

I’ve searched on how to connect SQL Database through Java scripts but I failed. I don’t know how to do it although we have a SQL server online, but I can’t find any help on the Web. I hope this time somebody could help me with my problem.
