Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Odbc Sqlserver Unix

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Quick Start: DataDirect Connect® for ODBC SQL Server

Wire Protocol Driver on UNIX and Linux


The following basic information enables you to connect with and test your DataDirect Connect® for ODBC
SQL Server Wire Protocol driver immediately after installation. For installation instructions for DataDirect
Connect for ODBC, please see the DataDirect Connect and Connect XE for ODBC Installation Guide.

Connecting to a Database
Once the DataDirect Connect for ODBC drivers are installed, you can connect from your application to your
database.

Environment Setup
1 Check your permissions: Log in as a user with full r/w/x permissions recursively on the entire
DataDirect Connect for ODBC installation directory.

2 Determine which shell you are running: Execute the env command.

3 Run the DataDirect Technologies setup script to set variables: Two scripts, odbc.csh and
odbc.sh, are installed in the installation directory. For Korn, Borne, and equivalent shells, execute
odbc.sh. For a C shell, execute odbc.csh. After running the setup script, execute the env command to
verify that the installation_directory/lib directory has been added to your shared library path.

4 Set ODBCINI variable: You must set the ODBCINI environment variable. The variable should point
to the path from the root directory to the odbc.ini file where your data source will reside. DataDirect
Connect for ODBC is installed with a template odbc.ini in the installation directory. For example:

$ ODBCINI= /opt/odbc/odbc.ini; export ODBCINI

Test Loading the Driver


The ivtestlib tool is a utility to verify that the driver can be loaded into memory; it is located in the
installation_directory/bin directory. For example, to load the SQL Server Wire Protocol driver on Solaris
(where xx represents the driver level number), you would enter:

$ ivtestlib /opt/odbc/lib/ivmsssxx.so

Setting up a Data Source in the odbc.ini


The default odbc.ini installed in the installation directory is a template into which you enter your site-
specific database connection information using a text editor. Each database has its own section in the
template. On Solaris, for example, you might enter:

[SQL Server Wire Protocol]


Driver=/opt/odbc/lib/ivmsssxx.so
Description=connection to my accounting database
Database=master
Address=123.456.78.90, 1433
Testing the Connection
The DataDirect Connect for ODBC installation includes a program called example that can be used to
connect to a data source and execute SQL. The application is located in the
installation_directory/example directory. To run the program, type example and follow the prompts to
enter your data source name, user name, and password. If successful, a SQL> prompt appears and you
can type in SQL Statements such as Select * from <table_name>. If example is unable to connect,
the appropriate error message is displayed.

© 2006. DataDirect Technologies Corp. All rights reserved.

5/06, 5.2

You might also like