connect to database with javascript