Connect to database through json.