• Topic
  • Discussion
  • VirtuosoWikiWeb.UnixODBCtoVirt(Last) -- Owiki? , 2016-08-19 15:01:35 Edit owiki 2016-08-19 15:01:35

    Connect to Virtuoso (ODBC, JDBC, OLE DB, .NET)

    ODBC Data Access Drivers (Unix Client)

    Configure the DSN

    1. cd into the machine that hosts your Virtuoso client installation.

    2. Use the bash or sh command to open a bash or bourne shell.

    3. cd into the root of the Virtuoso installation.

    4. Execute this command: ./virtuoso.sh

    5. cd into the bin sub-directory of your Virtuoso installation.

    6. vi the odbc.ini file.

    7. Locate this section:

    [Local Virtuoso]
    Description = Virtuoso database
    Driver      = /dbs/virtuoso/qa/lib/virtodbc_r.so.1
    Address     = localhost:1111
    

    8. Choose to use, modify, or copy and paste it as a template.

    9. Ensure the name in square brackets [] reflects your desired DSN name.

    10. Use Description to pass an optional accounf ot the use or nature of this DSN.

    11. Ensure the Driver path is correct.

    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.

    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.

    14. Save any changes and exit the file.

    Test the DSN

    1. cd into the ~/samples/ODBC sub-directory of your installation.

    2. Execute this command: ./odbctest

    3. Pass a question mark to the odbctest prompt. For example:

    bash-2.03$ ./odbctest
    OpenLink ODBC Demonstration program
    This program shows an interactive SQL processor
    
    Enter ODBC connect string (? shows list):  ?
    
    


    4. Locate your DSN in the list.

    5. Pass DSN

    followed by your DSN. For example:

    Enter ODBC connect string (? shows list): DSN=Virtuoso
    


    6. Wait for the SQL prompt to appear.

    7. Type in a query.

    8. Hit enter.

    9. Review your resultset.

    10. You can now use the "tables" command (without quotes) to get a list of tables, or you may run other valid sql statement.


    Referenced by...