Creating a Data Source Name

When connecting to your data store using a DSN, you only need to configure the odbc.ini file. Set the properties in the odbc.ini file to create a DSN that specifies the connection information for your data store. For information about configuring a DSN-less connection instead, see Configuring a DSN-less Connection.

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

To create a Data Source Name:

  1. In a text editor, open the odbc.ini configuration file.
  2. Note:

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

  3. In the [ODBC Data Sources] section, add a new entry by typing a name for the DSN, an equal sign (=), and then the name of the connector.
  4. For example, on a macOS machine:

    [ODBC Data Sources]

    Sample DSN=Simba DynamoDB ODBC Connector

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

    [ODBC Data Sources]

    Sample DSN=Simba DynamoDB ODBC Connector 32-bit

  5. Create a section that has the same name as your DSN, and then specify 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/dynamodbodbc/lib/libsimbadynamodbodbc.dylib

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

      Driver=/opt/simba/dynamodbodbc/lib/32/libsimbadynamodbodbc32.so

    3. Do one of the following:
      • If you are connecting to the DynamoDB service on AWS, then do the following:
        1. Set the Host property to the endpoint for the DynamoDB service.
        2. For example:

          Host=dynamodb.us-west-2.amazonaws.com

        3. Set the Region property to AWS region to use for your connection.
        4. For example:

          Region=us-west-2

        5. Configure authentication by specifying the authentication mechanism and credentials to use. For more information, see Configuring Authentication.
      • Or, if you are connecting to a server on DynamoDB Local, then do the following:
        1. Set the DynamoDBLocal property to 1.
        2. Set the Host property to the IP address or host name of the server.
        3. Set the Port property to the number of the TCP port that the server uses to listen for client connections.
        4. Set the Region and AccessKey properties as needed to specify the database file that you want to connect to. For information about how these values are used in connections to DynamoDB Local, see "DynamoDB Local for Desktop Development" in the AWS Official Blog: https://aws.amazon.com/blogs/aws/dynamodb-local-fordesktop- development.
        5. Set the SecretKey property to an arbitrary value. For information about how this value is used in connections to DynamoDB Local, see "DynamoDB Local for Desktop Development" in the AWS Official Blog: https://aws.amazon.com/blogs/aws/dynamodb-local-fordesktop- development.
      • For example:

        DynamoDBLocal=1

        Host=192.168.222.160

        Port=8000

        Region=us-west-2

        AccessKey=ABCABCABC123ABCABC45

        SecretKey=NullText

    4. Optionally, set additional key-value pairs as needed to specify other optional connection settings. For detailed information about all the configuration options supported by the Simba DynamoDB ODBC Connector, see Driver Configuration Options on page 1.
  6. Save the odbc.ini configuration file.
  7. 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 ODBCINI environment variable specifies the location. For more information, see .

For example, the following is an odbc.ini configuration file for macOS containing a DSN that connects to the DynamoDB service on AWS and authenticates the connection using an access key and a secret key:

[ODBC Data Sources]

Sample DSN=Simba DynamoDB ODBC Connector

[Sample DSN]

Driver=/Library/simba/dynamodbodbc/lib/libsimbadynamodbodbc.dylib

Host=dynamodb.us-west-2.amazonaws.com

Region=us-west-2

AuthMechanism=0

AccessKey=ABCABCABC123ABCABC45

SecretKey=abCD+E1f2Gxhi3J4klmN/OP5QrSTuvwXYzabcdEF

For example, the following is an odbc.ini configuration file for a 32-bit connector on a Linux machine, containing a DSN that connects to the DynamoDB service on AWS and authenticates the connection using an access key and a secret key:

[ODBC Data Sources]

Sample DSN=Simba DynamoDB ODBC Connector 32-bit

[Sample DSN]

Driver=/opt/simba/dynamodbodbc/lib/32/libsimbadynamodbodbc32.so

Host=dynamodb.us-west-2.amazonaws.com

Region=us-west-2

AuthMechanism=0

AccessKey=ABCABCABC123ABCABC45

SecretKey=abCD+E1f2Gxhi3J4klmN/OP5QrSTuvwXYzabcdEF

You can now use the DSN in an application to connect to the data store.