If using TNS entry, set TNS_ADMIN environment variable pointing to folder with tnsnames.ora :

The driver needs to know where the database is located. While you can enter connection strings manually, the industry standard is using a tnsnames.ora file.

While it sounds simple, setting it up can be notoriously tricky due to version mismatches and configuration requirements. This guide covers everything you need to know to get connected.