<docbook><section><title>UnixODBCtoVirt</title><bridgehead class="http://www.w3.org/1999/xhtml:h2">Connect to Virtuoso (ODBC, JDBC, OLE DB, .NET)</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">ODBC Data Access Drivers (Unix Client)</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h4">Configure the DSN</bridgehead>
<para>1.
 cd into the machine that hosts your Virtuoso client installation.</para><para>2.
 Use the bash or sh command to open a bash or bourne shell.</para><para>3.
 cd into the root of the Virtuoso installation.</para><para>4.
 Execute this command: ./virtuoso.sh</para><para>5.
 cd into the bin sub-directory of your Virtuoso installation.</para><para>6.
 vi the odbc.ini file.</para><para>7.
 Locate this section: </para><programlisting>[Local Virtuoso]
Description = Virtuoso database
Driver      = /dbs/virtuoso/qa/lib/virtodbc_r.so.1
Address     = localhost:1111
</programlisting><para>8.
 Choose to use, modify, or copy and paste it as a template.</para><para>9.
 Ensure the name in square brackets [] reflects your desired DSN name.</para><para>10.
 Use Description to pass an optional accounf  ot the use or nature of this DSN.</para><para>11.
 Ensure the Driver path is correct.</para><para>12.
 Ensure Address passes the IP address or hostname of the Virtuoos DBMS server followed by the Virtuoso TCP port.
 The two are separated by a colon.</para><para>13.
 If you created a new DSN or modified the name of the exisitng DSN, make sure the correct name appears in the list under [ODBC Data Sources].
 It should pass Virtuoso after the equal sign.</para><para>14.
 Save any changes and exit the file.</para><bridgehead class="http://www.w3.org/1999/xhtml:h4">Test the DSN</bridgehead>
<para>1.
 cd into the ~/samples/ODBC sub-directory of your installation.</para><para>2.
 Execute this command: ./odbctest</para><para>3.
 Pass a question mark to the odbctest prompt.
 For example:</para><programlisting>bash-2.03$ ./odbctest
OpenLink ODBC Demonstration program
This program shows an interactive SQL processor

Enter ODBC connect string (? shows list):  ?

</programlisting><para> 4.
 Locate your DSN in the list.</para><para>5.
 Pass DSN</para><para> followed by your DSN.
 For example:</para><programlisting>Enter ODBC connect string (? shows list): DSN=Virtuoso
</programlisting><para> 6.
 Wait for the SQL prompt to appear.</para><para>7.
 Type in a query.</para><para>8.
 Hit enter.</para><para>9.
 Review your resultset.</para><para>10.
 You can now use the &quot;tables&quot; command (without quotes) to get a list of tables, or you may run other valid sql statement.
</para></section></docbook>