此内容没有您所选择的语言版本。
10.5. ODBC Setup
10.5.1. Configure ODBC Options on Microsoft Windows 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Prerequisites
- You must have logged into the workstation with administrative rights.
- You need to have used the Control Panel’s Data Sources (ODBC) applet to add a new data source name.Each data source name you configure can only access one VDB within a Teiid System. To make more than one VDB available, you need to configure more than one data source name.
Procedure 10.5. Configure the Data Source Name (DSN) on Microsoft Windows
- From themenu, select - .
- The Control Panel displays. Double-click Administrative Tools.
- Double-click Data Sources (ODBC).
- The ODBC Data Source Administrator applet displays. Click the tab associated with the type of DSN you want to add.
- The Create New Data Source dialog box displays. In the Select a driver for which you want to set up a data source table, select .
- Click.
- In the Data Source Name edit box, type the name you want to assign to this data source.
- In the Database edit box, type the name of the virtual database you want to access through this data source.
- In the Server edit box, type the host name or IP address of your Teiid runtime.
Note
If you are connecting via a firewall or NAT address, you must enter either the firewall address or the NAT address. - In the Port edit box, type the port number to which the system listens for ODBC requests. (By default, Red Hat JBoss Data Virtualization listens for ODBC requests on port 35432.)
- In the User Name and Password edit boxes, supply the user name and password for the Teiid runtime access.
- Leave SSL Mode to disabled. (SSL connections are unsupported at present.)
- Provide any description about the data source in the Description field.
- Click on thebutton and configure the options. Tick Parse Statements, Recognize Unique Indexes, Maximum, Text as LongVarChar and Bool as Char and set MaxVarChar to 255, Max LongVarChar to 8190, Cache Size to 100 and SysTable Prefixes to dd_:.On the second page, click LF, Updatable Cursors, bytea as LO, default, 7.4+ and set the Extra Opts to 0x0.
- Click.You can optionally clickto validate your connection if Red Hat JBoss Data Virtualization is running.
Result
You can now use applications such as Excel, Access to query the data in the VDB
Procedure 10.6. Configure ODBC Options on Red Hat Enterprise Linux
- Run this command to install the driver manager:
yum install unixODBC
. - Run this command to verify that your PostGreSQLdriver has installed correctly:
odbcinst -q -d
. - To create the DSN, open the configuration file in a text editor:
sudo vi /opt/redhat/odbc.ini
Note
You must either use sudo or be logged in as root to open this file. - Add the following configuration settings to the file:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the file and exit the text editor.
- Run this command to test the DSN:
isql <DSN-name> [<user-name> <password>] < commands.sql
isql <DSN-name> [<user-name> <password>] < commands.sql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
To connect without DSN, use this DSN-less connection string:ODBC;DRIVER={PostgreSQL};DATABASE=<vdb-name>;SERVER=<host-name>;PORT=<port>;Uid=<username>;Pwd=<password>
ODBC;DRIVER={PostgreSQL};DATABASE=<vdb-name>;SERVER=<host-name>;PORT=<port>;Uid=<username>;Pwd=<password>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow