<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/ODBC+Support">ODBC Support</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* Updateable cursors are not supported.  You will receive parsing errors containing the pg system column ctid if this feature is not disabled. <br>* LO support is not available.  LOBs will be returned as string or bytea as appropriate using the transport max lob size setting. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* The Teiid object type will map to the PostgreSQL UNKNOWN type, which cannot be serialized by the ODBC layer.  Cast/Convert should be used to provide a type hint when appropriate - for example teiid_session_set returns an object value. &quot;SELECT teiid_session_set(&#39;x&#39;, &#39;y&#39;)&quot; will fail, but &quot;SELECT cast(teiid_session_set(&#39;x&#39;, &#39;y&#39;) as string)&quot; will succeed. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>Before an application can use ODBC, you must first install the ODBC driver on same machine that the application is running on and then create a Data Source Name (DSN) that represents a connection profile for your Teiid VDB. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>Open Database Connectivity (ODBC) is a standard database access method developed by the SQL Access group in 1992. ODBC, just like JDBC in Java, allows consistent client access regardless of which database management system (DBMS) is handling the data.  ODBC uses a driver to translate the application's data queries into commands that the DBMS understands. For this to work, both the application and the DBMS must be ODBC-compliant &#45;&#45; that is, the application must be capable of issuing ODBC commands and the DBMS must be capable of responding to them.</p>

<p>Teiid can provide ODBC access to deployed VDBs in the Teiid runtime through <a href="http://www.postgresql.org/" class="external-link" rel="nofollow">PostgreSQL</a>'s ODBC driver. This is possible because Teiid has a PostgreSQL server emulation layer accessible via socket clients.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>By default, ODBC is enabled and running on on port <em>35432</em>.</td></tr></table></div>

<p>The pg emulation is not complete.  The intention of the ODBC access is to provide non-JDBC connectivity to issue Teiid queries - not pgsql queries.  While many PostgreSQL constructs are supported the default behavior for queries matches Teiid's expectations.  See <a href="/author/display/TEIID/System+Properties" title="System Properties">System Properties</a> for optional properties that further emulate pgsql handling.</p>

<p>Known Limitations:</p>
<ul>
        <li>Updateable cursors are not supported.  You will receive parsing errors containing the pg system column ctid if this feature is not disabled.</li>
        <li>LO support is not available.  LOBs will be returned as string or bytea as appropriate using the transport max lob size setting.</li>
        <li>The Teiid object type will map to the PostgreSQL UNKNOWN type, which cannot be serialized by the ODBC layer.  Cast/Convert should be used to provide a type hint when appropriate - for example teiid_session_set returns an object value. "SELECT teiid_session_set('x', 'y')" will fail, but "SELECT cast(teiid_session_set('x', 'y') as string)" will succeed.</li>
</ul>


<p>Before an application can use ODBC, you must first install the ODBC driver on same machine that the application is running on and then create a Data Source Name (DSN) that represents a connection profile for your Teiid VDB.</p>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>By default Teiid supports plain text password authentication for ODBC. If the client/server are not configured to use SSL, the password will be sent in plain text over the network. If you need secure passwords in transit and are not using SSL, then consider installing a security domain that will accept safe password values from the client (for example encrypted or hashed).</td></tr></table></div>

<p>See the <a href="/author/display/TEIID/Security+Guide" title="Security Guide">Security Guide</a> for details on configuring SSL for and using Kerberos with the pg transport.</p>

<p>Many times is is not possible to use Teiid specific connection properties when making an ODBC connection.  If you find yourself in this situation and cannot use post connection SET statements, then the VDB itself may take default connection properties for ODBC.  Use VDB properties of the form connection.XXX to control things like partial results mode, result set caching, etc.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/ODBC+Support">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646141&revisedVersion=9&originalVersion=8">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/ODBC+Support?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>