<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/Connecting+to+a+Teiid+Server">Connecting to a Teiid Server</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (0)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>The Teiid JDBC API provides Java Database Connectivity (JDBC) access to any Virtual Database (VDB) deployed on a Teiid Server. The Teiid JDBC API is compatible with the JDBC 4.0 specification; however, it does not fully support all methods. Advanced features, such as updatable result sets or SQL3 data types, are not supported.</p>

<p>Java client applications connecting to a Teiid Server will need to use Java 1.6 JDK. Previous versions of Java are not supported.</p>

<p>Before you can connect to the Teiid Server using the Teiid JDBC API, please do following tasks first.</p>

<ol>
        <li>Install the Teiid Server. See the "Admin Guide" for instructions.</li>
        <li>Build a Virtual Database (VDB). You can either build a "Dynamic VDB" (Designer not required), or you can use the Eclipse based GUI tool <a href="http://www.jboss.org/teiiddesigner.html" class="external-link" rel="nofollow">Designer</a>. Check the "Reference Guide" for instructions on how to build a VDB. If you do not know what VDB is, then start with this <a href="http://www.jboss.org/teiid/basics/virtualdatabases.html" class="external-link" rel="nofollow">document</a>.</li>
        <li>Deploy the VDB into Teiid Server. Check <a href="/author/display/TEIID/Administrator%27s+Guide" title="Administrator&#39;s Guide">Administrator's Guide</a> for instructions.</li>
        <li>Start the Teiid Server (JBoss AS), if it is not already running.</li>
</ol>


<p>Now that you have the VDB deployed in the Teiid Server, client applications can connect to the Teiid Server and issue SQL queries against deployed VDB using JDBC API. If you are new to JDBC, see Java's documentation about <a href="http://java.sun.com/docs/books/tutorial/jdbc/index.html" class="external-link" rel="nofollow">JDBC</a>. Teiid ships with teiid&#45;8.3.0.Final&#45;jdbc.jar that can be found in the <a href="http://www.jboss.org/teiid/downloads.html" class="external-link" rel="nofollow">downloads</a>.</p>

<p>Main classes in the client JAR:</p>

<ul>
        <li><tt>org.teiid.jdbc.TeiidDriver</tt>&#45; allows JDBC connections using the <a href="http://java.sun.com/javase/6/docs/api/java/sql/DriverManager.html" class="external-link" rel="nofollow">DriverManager</a> class.</li>
</ul>


<ul>
        <li><tt>org.teiid.jdbc.TeiidDatasource</tt>&#45; allows JDBC connections using the <a href="http://java.sun.com/javase/6/docs/api/javax/sql/DataSource.html" class="external-link" rel="nofollow">DataSource</a> or <a href="http://java.sun.com/javase/6/docs/api/javax/sql/XADataSource.html" class="external-link" rel="nofollow">XADataSource</a> class. You should use this class to create managed or XA connections.</li>
</ul>



<p>Once you have established a connection with the Teiid Server, you can use standard JDBC API classes to interrogate metadata and execute queries.</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/Connecting+to+a+Teiid+Server">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646112&revisedVersion=4&originalVersion=3">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Connecting+to+a+Teiid+Server?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>