Configuring a DSN-less Connection

To connect to your data store through a DSN-less connection, you need to define the connector in the odbcinst.ini file and then provide a DSN-less connection string in your application.

If your machine is already configured to use an existing odbcinst.ini file, then update that file by adding the settings described below. Otherwise, copy the odbcinst.ini file from the Setup subfolder in the connector installation directory to the home directory, and then update the file as described below.

To define a connector:

  1. In a text editor, open the odbcinst.ini configuration file.

    Note: If you are using a hidden copy of the odbcinst.ini file, you can remove the period (.) from the start of the file name to make the file visible while you are editing it.

  2. In the [ODBC Drivers] section, add a new entry by typing a name for the connector, an equal sign (=), and then Installed.

    For example:

    [ODBC Drivers]

    Simba Apache Spark ODBC Connector=Installed

    Simba Spark ODBC Driver=Installed

  3. Create a section that has the same name as the connector (as specified in the previous step), and then specify the following configuration options as key-value pairs in the section:
    1. Set the Driver property to the full path of the connector library file that matches the bitness of the application.
    2. For example, on a macOS machine:

      Driver=/Library/simba/spark/lib/libsparkodbc_sb64-universal.dylib.

      For example, for a 32-bit connector on a Linux machine:

      Driver=/opt/simba/spark/lib/32/libsparkodbc_sb32.so

    3. Optionally, set the Description property to a description of the connector.
    4. For example:

      Description=Simba Apache Spark ODBC Connector

  4. Save the odbcinst.ini configuration file.

    Note: If you are storing this file in its default location in the home directory, then prefix the file name with a period (.) so that the file becomes hidden. If you are storing this file in another location, then save it as a non-hidden file (without the prefix), and make sure that the ODBCINSTINI or ODBCSYSINI environment variable specifies the location. For more information, see Specifying the Locations of the Connector Configuration Files.

    For example, the following is an odbcinst.ini configuration file for macOS:

    [ODBC Drivers]

    Simba Apache Spark ODBC Connector=Installed

    Simba Spark ODBC Driver=Installed

    Simba Spark ODBC Driver=Installed

    [Simba Apache Spark ODBC Connector]

    [SimbaSpark ODBC Driver]

    Description=Simba Apache Spark ODBC Connector

    Driver=/Library/simba/spark/lib/libsparkodbc_sb64-universal.dylib

    For example, the following is an odbcinst.ini configuration file for both the 32- and 64-bit connectors in Linux:

    [ODBC Drivers]

    Simba Apache Spark ODBC Connector 32-bit=Installed

    Simba Spark ODBC Driver 32-bit=Installed

    Simba Apache Spark ODBC Connector 64-bit=Installed

    Simba Spark ODBC Driver 64-bit=Installed

    [Simba Apache Spark ODBC Connector 32-bit]

    [Simba Spark ODBC Driver 32-bit]

    Description=Simba Apache Spark ODBC Connector (32-bit)

    Driver=/opt/simba/spark/lib/32/libsparkodbc_sb32.so

    [Simba Apache Spark ODBC Connector 64-bit]

    [Simba Spark ODBC Driver 64-bit]

    Description=Simba Apache Spark ODBC Connector (64-bit)

    Driver=/opt/simba/spark/lib/64/libsparkodbc_sb64.so

You can now connect to your data store by providing your application with a connection string where the Driver property is set to the connector name specified in the odbcinst.ini file, and all the other necessary connection properties are also set. For more information, see "DSN-less Connection String Examples" in Using a Connection String.

For detailed information about all the connection properties that the connector supports, see .