connection to database from external tool