Some common reasons that setup/connection issues occur are:
The database and/or listener are not started.
The ODBCINI environment variable is not set correctly for the ODBC drivers on UNIX and Linux.
The ODBC driver’s connection attributes are not set correctly in the system information file on UNIX and Linux. See Data Source Configuration on UNIX/Linux for more information. For example, the host name or port number are not correctly configured. See Connection Option Descriptions for Apache Spark SQL for a list of connection string attributes that are required for each driver to connect properly to the underlying database.