<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/JDBC+Translator">JDBC Translator</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" >h2. Importer Properties - shared by all JDBC Translators <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >When specifying the importer property, it must be prefixed with &quot;importer.&quot;.   Example:   <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">importer.importer.tableTypes</span> <span class="diff-added-words"style="background-color: #dfd;">importer.tableTypes</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>|| Name || Description || Default || <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="JDBCTranslator-JDBCTranslator"></a>JDBC Translator</h1>

<p>The JDBC translator bridges between SQL semantic and data type difference between Teiid and a target RDBMS. Teiid has a range of specific translators that target the most popular open source and proprietary databases.</p>

<h3><a name="JDBCTranslator-jdbcansi"></a><em>jdbc-ansi</em></h3>

<p>Declares support for most SQL constructs supported by Teiid, except for row limit/offset and EXCEPT/INTERCECT. Translates source SQL into ANSI compliant syntax. This translator should be used when another more specific type is not available.</p>

<h3><a name="JDBCTranslator-jdbcsimple"></a><em>jdbc-simple</em></h3>

<p>Same as jdbc-ansi, except disables support for function, UNION, and aggregate pushdown.</p>

<h3><a name="JDBCTranslator-access"></a><em>access</em></h3>

<p>For use with Microsoft Access 2003 or later.</p>

<h3><a name="JDBCTranslator-db2"></a><em>db2</em></h3>

<p>For use with DB2 8 or later and DB2 for i 5.4 or later.</p>

<p>DB2 specific execution properties:</p>
<ul>
        <li><em>DB2ForI</em>&#45; indicates that the the DB2 instance is DB2 for i. Defaults to false.</li>
</ul>


<h3><a name="JDBCTranslator-derby"></a><em>derby</em></h3>

<p>For use with Derby 10.1 or later.</p>

<h3><a name="JDBCTranslator-excelodbc"></a><em>excel-odbc</em></h3>

<p>For use with Excel 2003 or later via the JDBC-ODBC bridge.</p>

<h3><a name="JDBCTranslator-greenplum"></a><em>greenplum</em></h3>

<p>For use with the Greenplum database.</p>

<h3><a name="JDBCTranslator-h2"></a><em>h2</em></h3>

<p>For use with H2 version 1.1 or later.</p>

<h3><a name="JDBCTranslator-hive"></a><em>hive</em></h3>

<p>For use with Hive database based on Hadoop. Hive is a data warehousing infrastructure based on the Hadoop thatp provides massive scale out and fault tolerance capabilities for data storage and processing (using the map-reduce programming paradigm) on commodity hardware.</p>

<p>Hive has limited support for data types. It is does not have native support for time/timestamp/xml or LOBs. These limitations are reflected in the translator capabilities. A Teiid view can use these types, however the transformation would need to specify the necessary conversions. Note that in those situations, the evaluations will be done in Teiid engine.</p>

<p>Hive only supports EQUI join, so using any other joins types on its source tables will result in inefficient queries.</p>

<p>Currently there is no tooling support for metadata import from Hive in Designer. To write criteria based on partitioned columns, modeled them on source table, but do not include them in selection columns.</p>

<p>Hive specific importer properties:</p>
<ul>
        <li><em>trimColumnNames</em>&#45; For Hive 0.11.0 and later the the DESCRIBE command metadata is <a href="https://issues.jboss.org/browse/TEIID-2524" class="external-link" rel="nofollow">inappropriately returned with padding</a>, set to true to strip trim white space from column names. Defaults to false.</li>
</ul>


<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>The Hive importer does not currently use typical JDBC DatabaseMetaData calls, nor does it have the concept of catalog or source schema, nor does it import keys, procedures, indexes, etc.  Thus not all of the common JDBC importer properties are applicable to Hive.  You may still use excludeTables.</td></tr></table></div>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Impala requires the use of a LIMIT when performing an ORDER BY.  If no default is configured in Impala, then an exception can occur when a Teiid query with an ORDER BY but no LIMIT is issued.  You should set an Impala wide default, or configure the connection pool to use a new connection sql string to issue a SET DEFAULT_ORDER_BY_LIMIT statement. See the <a href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/Impala/latest/Installing-and-Using-Impala/ciiu_langref_sql.html?scroll=limit_unique_1" class="external-link" rel="nofollow">Cloudera docs</a> for more on limit options - such as controlling what happens when the limit is exceeded.</td></tr></table></div>


<h3><a name="JDBCTranslator-hsql"></a><em>hsql</em></h3>

<p>For use with HSQLDB 1.7 or later.</p>

<h3><a name="JDBCTranslator-ingres"></a><em>ingres</em></h3>

<p>For use with Ingres 2006 or later.</p>

<h3><a name="JDBCTranslator-ingres93"></a><em>ingres93</em></h3>

<p>For use with Ingres 9.3 or later.</p>

<h3><a name="JDBCTranslator-intersystemscache"></a><em>intersystems-cache</em></h3>

<p>For use with Intersystems Cache Object database (only relational aspect of it)</p>

<h3><a name="JDBCTranslator-informix"></a><em>informix</em></h3>

<p>For use with any Informix version.</p>

<h3><a name="JDBCTranslator-metamatrix"></a><em>metamatrix</em></h3>

<p>For use with MetaMatrix 5.5.0 or later.</p>

<h3><a name="JDBCTranslator-modeshape"></a><em>modeshape</em></h3>

<p>For use with Modeshape 2.2.1 or later. The PATH, NAME, LOCALNODENAME, DEPTH, and SCORE functions should be accessed as pseudo-columns, e.g. "nt:base"."jcr:path". Teiid UFDs (prefixed by JCR_) are available for CONTIANS, ISCHILDNODE, ISDESCENDENT, ISSAMENODE, REFERENCE - see the JCRFunctions.xmi. If a selector name is needed in a JCR function, you should use the pseudo-column "jcr:path", e.g. JCR_ISCHILDNODE(foo.jcr_path, 'x/y') would become ISCHILDNODE(foo, 'x/y') in the ModeShape query. An additional pseudo-column "mode:properties" should be imported by setting the ModeShape JDBC connection property teiidsupport=true. The column "mode:properties" should be used by the JCR_REFERENCE and other functions that expect a .&#42; selector name, e.g. JCR_REFERENCE(nt_base.jcr_properties) would become REFERENCE("nt:base".*) in the ModeShape query.</p>

<h3><a name="JDBCTranslator-mysqlmysql5"></a><em>mysql</em> <em>mysql5</em></h3>

<p>For use with MySQL version 4.x and 5 or later respectively.</p>

<p>The MySQL Translators expect the database or session to be using ANSI mode. If the database is not using ANSI mode, an initialization query should be used on the pool to set ANSI mode:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">set SESSION sql_mode = 'ANSI'</pre>
</div></div>

<h3><a name="JDBCTranslator-netezza"></a><em>netezza</em></h3>

<p>For use with any Netezza version.</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>The current Netezza vendor supplied JDBC driver performs poorly with single transactional updates.  As is generally the case when possible use batched updates.</td></tr></table></div>

<h3><a name="JDBCTranslator-oracle"></a><em>oracle</em></h3>

<p>For use with Oracle 9i or later.</p>

<p>Sequences may be used with the Oracle translator. A sequence may be modeled as a table with a name in source of DUAL and columns with the name in source set to{{&lt;sequence name&gt;.[nextval&#124;currval].}}</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Teiid 8.4 and Prior Oracle Sequence DDL</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
CREATE FOREIGN TABLE seq (nextval integer OPTIONS (NAMEINSOURCE 'seq.nextval'), currval (NAMEINSOURCE 'seq.currval') ) OPTIONS (NAMEINSOURCE 'DUAL')
</pre>
</div></div>

<p>With Teiid 8.5 it's no longer necessary to rely on a table representation and Oracle specific handling for sequences.  See <a href="/author/display/TEIID/DDL+Metadata" title="DDL Metadata">DDL Metadata</a> for representing currval and nextval as source functions.</p>

<p>You can also use a sequence as the default value for insert columns by setting the column to autoincrement and the name in source to&nbsp;<tt>&lt;element name&gt;:SEQUENCE=&lt;sequence name&gt;.&lt;sequence value&gt;</tt>.</p>

<p>A rownum column can also added to any Oracle physical table to support the rownum pseudo-column. A rownum column should have a name in source of&nbsp;<tt>rownum</tt>. These rownum columns do not have the same semantics as the Oracle rownum construct so care must be taken in their usage.</p>

<p>Oracle specific execution properties:</p>
<ul>
        <li><em>OracleSuppliedDriver</em>&#45; indicates that the Oracle supplied driver (typically prefixed by ojdbc) is being used. Defaults to true. Set to false when using DataDirect or other Oracle JDBC drivers.</li>
</ul>


<h3><a name="JDBCTranslator-postgresql"></a><em>postgresql</em></h3>

<p>For use with 8.0 or later clients and 7.1 or later server.</p>

<h3><a name="JDBCTranslator-sqlserver"></a><em>sqlserver</em></h3>

<p>For use with SQL Server 2000 or later. A SQL Server JDBC driver version 2.0 or later (or compatible e.g. JTDS 1.2 or later) should be used.&nbsp; The SQL Server DatabaseVersion property may be set to 2000, 2005, 2008, or 2012, but otherwise expects a standard version number - e.g. "10.0".</p>

<p>SQL Server specific execution properties:</p>
<ul>
        <li><em>JtdsDriver</em>&#45; indicates that the open source JTDS driver is being used. Defaults to false.</li>
</ul>


<h3><a name="JDBCTranslator-sybase"></a><em>sybase</em></h3>

<p>For use with Sybase version 12.5 or later.&nbsp;</p>

<p>If the name in source metadata contains quoted identifiers (such as required by reserved words or words containing characters that would not otherwise be allowed) and you are using a jconnect Sybase driver, you must first configure the connection pool to enable <b>quoted_identifier</b>:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Driver URL with SQLINITSTRING</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
jdbc:sybase:Tds:host.at.some.domain:5000/db_name?SQLINITSTRING=set quoted_identifier on
</pre>
</div></div>
<p>Sybase specific execution properties:</p>
<ul>
        <li><em>JtdsDriver</em>&#45; indicates that the open source JTDS driver is being used. Defaults to false.</li>
</ul>


<h3><a name="JDBCTranslator-teiid"></a><em>teiid</em></h3>

<p>For use with Teiid 6.0 or later.</p>

<h3><a name="JDBCTranslator-teradata"></a><em>teradata</em></h3>

<p>For use with Teradata V2R5.1 or later.</p>

<h2><a name="JDBCTranslator-ExecutionPropertiessharedbyallJDBCTranslators"></a>Execution Properties - shared by all JDBC Translators</h2>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Default </th>
</tr>
<tr>
<td class='confluenceTd'> DatabaseTimeZone </td>
<td class='confluenceTd'> The time zone of the database. Used when fetchings date, time, or timestamp values. </td>
<td class='confluenceTd'> The system default time zone </td>
</tr>
<tr>
<td class='confluenceTd'> DatabaseVersion </td>
<td class='confluenceTd'> The specific database version. Used to further tune pushdown support. </td>
<td class='confluenceTd'> The base supported version or derived from the DatabaseMetadata.getProduceVersion string.  Automatic detection requires a Connection.  If there are circumstances where you are getting an exception from capabilities being unavailable (most likely due to an issue obtaining a Connection), then set DatabaseVersion property.  Use the JDBCExecutionFactory.usesDatabaseVersion() method to control whether your translator requires a connection to determine capabilities. </td>
</tr>
<tr>
<td class='confluenceTd'> TrimStrings </td>
<td class='confluenceTd'> true to trim trailing whitespace from fixed length character strings. Note that Teiid only has a string, or varchar, type that treats trailing whitespace as meaningful. </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> UseBindVariables </td>
<td class='confluenceTd'> true to indicate that PreparedStatements should be used and that literal values in the source query should be replace with bind variables. If false only LOB values will trigger the use of PreparedStatements. </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> UseCommentsInSourceQuery </td>
<td class='confluenceTd'> This will embed a leading comment with session/request id in source SQL query for informational purposes </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> MaxPreparedInsertBatchSize </td>
<td class='confluenceTd'> The max size of a prepared insert batch. </td>
<td class='confluenceTd'> 2048 </td>
</tr>
<tr>
<td class='confluenceTd'> StructRetrieval </td>
<td class='confluenceTd'> Struct retrieval mode can be one of OBJECT - getObject value returned, COPY - returned as a <tt>SerialStruct</tt>, ARRAY - returned as an <tt>Array</tt>) </td>
<td class='confluenceTd'> OBJECT </td>
</tr>
<tr>
<td class='confluenceTd'> EnableDependentJoins </td>
<td class='confluenceTd'> For sources that support temporary tables (DB2, Derby, H2, HSQL 2.0+, MySQL 5.0+, Oracle, PostgreSQL, SQLServer, Sybase) allow dependent join pushdown </td>
<td class='confluenceTd'> false </td>
</tr>
</tbody></table>
</div>


<h2><a name="JDBCTranslator-ImporterPropertiessharedbyallJDBCTranslators"></a>Importer Properties - shared by all JDBC Translators</h2>

<p>When specifying the importer property, it must be prefixed with "importer.".   Example:   importer.tableTypes</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Default </th>
</tr>
<tr>
<td class='confluenceTd'> catalog </td>
<td class='confluenceTd'> See DatabaseMetaData.getTablesFull [1] </td>
<td class='confluenceTd'> null </td>
</tr>
<tr>
<td class='confluenceTd'> schemaPattern </td>
<td class='confluenceTd'> See DatabaseMetaData.getTables [1] </td>
<td class='confluenceTd'> null </td>
</tr>
<tr>
<td class='confluenceTd'> tableNamePattern </td>
<td class='confluenceTd'> See DatabaseMetaData.getTables [1] </td>
<td class='confluenceTd'> null </td>
</tr>
<tr>
<td class='confluenceTd'> procedureNamePattern </td>
<td class='confluenceTd'> See DatabaseMetaData.getProcedures [1] </td>
<td class='confluenceTd'> null </td>
</tr>
<tr>
<td class='confluenceTd'> tableTypes </td>
<td class='confluenceTd'> Comma separated list - without spaces - of imported table types. See DatabaseMetaData.getTables [1] </td>
<td class='confluenceTd'> null </td>
</tr>
<tr>
<td class='confluenceTd'> excludeTables&nbsp; <br class="atl-forced-newline" /> </td>
<td class='confluenceTd'> A case-insensitive regular expression that when matched against a fully qualified Teiid table name will exclude it from import.&nbsp; Applied after table names are retrieved.&nbsp; Use a negative look-ahead (?&#33;&lt;inclusion pattern&gt;).&#42; to act as an inclusion filter. </td>
<td class='confluenceTd'> null&nbsp; <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td class='confluenceTd'> excludeProcedures&nbsp; <br class="atl-forced-newline" /> </td>
<td class='confluenceTd'> A case-insensitive regular expression that when matched against a fully qualified Teiid procedure name will exclude it from import.&nbsp; Applied after procedure names are retrieved.&nbsp; Use a negative look-ahead (?&#33;&lt;inclusion pattern&gt;).&#42; to act as an inclusion filter. </td>
<td class='confluenceTd'> null&nbsp; <br class="atl-forced-newline" /> </td>
</tr>
<tr>
<td class='confluenceTd'> useFullSchemaName </td>
<td class='confluenceTd'> When false, directs the importer to drop the source catalog/schema from the Teiid object name, so that the Teiid fully qualified name will be in the form of &lt;model name&gt;.&lt;table name&gt; - Note: when false this may lead to objects with duplicate names when importing from multiple schemas, which results in an exception.&nbsp; This option does not affect the name in source property. </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> importKeys </td>
<td class='confluenceTd'> true to import primary and foreign keys - NOTE foreign keys to tables that are not imported will be ignored </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> autoCreateUniqueConstraints </td>
<td class='confluenceTd'> true to create a unique constraint if one is not found for a foreign keys </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> importIndexes </td>
<td class='confluenceTd'> true to import index/unique key/cardinality information </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> importApproximateIndexes </td>
<td class='confluenceTd'> true to import approximate index information. See DatabaseMetaData.getIndexInfo [1] </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> importProcedures </td>
<td class='confluenceTd'> true to import procedures and procedure columns - Note that it is not always possible to import procedure result set columns due to database limitations. It is also not currently possible to import overloaded procedures. </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> widenUnsignedTypes </td>
<td class='confluenceTd'> true to convert unsigned types to the next widest type. For example SQL Server reports tinyint as an unsigned type. With this option enabled, tinyint would be imported as a short instead of a byte. </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> quoteNameInSource </td>
<td class='confluenceTd'> false will override the default and direct Teiid to create source queries using unquoted identifiers. </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> useProcedureSpecificName </td>
<td class='confluenceTd'> true will allow the import of overloaded procedures (which will normally result in a duplicate procedure error) by using the unique procedure specific name as the Teiid name. This option will only work with JDBC 4.0 compatible drivers that report specific names. </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> useCatalogName </td>
<td class='confluenceTd'> true will use any non-null/non-empty catalog name as part of the name in source, e.g. "catalog"."schema"."table"."column", and in the Teiid runtime name if useFullSchemaName is also true. false will not use the catalog name in either the name in source or the Teiid runtime name. Should be set to false for sources that do not fully support a catalog concept, but return a non-null catalog name in their metadata - such as HSQL. </td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> useQualifiedName </td>
<td class='confluenceTd'> true will use name qualification for both the Teiid name and name in source as dictated by the useCatalogName and useFullSchemaName properties.&nbsp; Set to false to disable all qualification for both the Teiid name and the name in source, which effectively ignores the useCatalogName and useFullSchemaName properties.&nbsp; Note: when false this may lead to objects with duplicate names when importing from multiple schemas, which results in an exception. </td>
<td class='confluenceTd'> true&nbsp; <br class="atl-forced-newline" /> </td>
</tr>
</tbody></table>
</div>

<p>[1] JavaDoc for&nbsp;<a href="http://java.sun.com/javase/6/docs/api/java/sql/DatabaseMetaData.html" class="external-link" rel="nofollow">DatabaseMetaData</a></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><b>Warning</b><br />The default import settings will crawl all available metadata. This import process is time consuming and full metadata import is not needed in most situations. Most commonly you'll want to limit the import by at least schemaPattern and tableTypes.</td></tr></table></div>
<p>Example importer settings to only import tables and views from my-schema.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
...
&lt;property name="importer.tableTypes" value="TABLE,VIEW"/&gt;
&lt;property name="importer.schemaPattern" value="my-schema"/&gt;
...
</pre>
</div></div>

<h2><a name="JDBCTranslator-Usage"></a>Usage</h2>

<p>Usage of a JDBC source is straight-forward. Using Teiid SQL, the source may be queried as if the tables and procedures were local to the Teiid system.</p>

<h3><a name="JDBCTranslator-NativeQueries"></a>Native Queries</h3>

<p>Physical tables, functions, and procedures may optionally have native queries associated with them.&nbsp; No validation of the native query is performed, it is simply used in a straight-forward manner to generate the source SQL.&nbsp; For a physical table setting the teiid_rel:native-query extension metadata will execute the native query as an inline view in the source query.&nbsp; This feature should only be used against sources that support inline views.&nbsp; The native query is used as is and is not treated as a parameterized string. For example on a physical table y with nameInSource="x" and teiid_rel:native-query="select c from g", the Teiid source query"SELECT c FROM y" would generate the SQL query "SELECT c FROM (select c from g) as x".&nbsp; Note that the column names in the native query must match the nameInSource of the physical table columns for the resulting SQL to be valid.</p>

<p>For physical procedures you may also set the teiid_rel:native-query extension metadata to a desired query string with the added ability to positionally reference IN parameters - see&nbsp;<a href="/author/display/TEIID/Translators#Translators-native">Parameterizable Native Queries</a>.&nbsp; The teiid_rel:non-prepared extension metadata property may be set to false to turn off parameter binding.&nbsp; Note this option should be used with caution as inbound may allow for SQL injection attacks if not properly validated.&nbsp; The native query does not need to call a stored procedure.&nbsp; Any SQL that returns a result set positionally matching the result set expected by the physical stored procedure metadata will work.&nbsp; For example on a stored procedure x with teiid_rel:native-query="select c from g where c1 = $1 and c2 = '$$1'", the Teiid source query "CALL x&#40;?)" would generate the SQL query "select c from g where c1 = ? and c2 = '$1'".&nbsp; Note that ? in this example will be replaced with the actual value bound to parameter 1.</p>

<h3><a name="JDBCTranslator-DirectQueryProcedure"></a>Direct Query Procedure</h3>

<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>This feature is turned off by default because of the security risk this exposes to execute any command against the source. To enable this feature, <a href="/author/display/TEIID/Translators#Translators-OverrideExecutionProperties">override the execution property</a> called <em>SupportsDirectQueryProcedure</em> to true.</td></tr></table></div>

<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 the name of the procedure that executes the queries directly is <b>native</b>. <a href="/author/display/TEIID/Translators#Translators-OverrideExecutionProperties">Override the execution property</a> <em>DirectQueryProcedureName</em> to change it to another name.</td></tr></table></div>

<p>The JDBC translator provides a procedure to execute any ad-hoc SQL query directly against the source without Teiid parsing or resolving. Since the metadata of this procedure's results are not known to Teiid, they are returned as an object array. <a href="/author/display/TEIID/ARRAYTABLE" title="ARRAYTABLE">ARRAYTABLE</a> can be used construct tabular output for consumption by client applications.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Select Example</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
SELECT x.* FROM (call jdbc_source.native('select * from g1')) w,
 ARRAYTABLE(w.tuple COLUMNS "e1" integer , "e2" string) AS x
</pre>
</div></div>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Insert Example</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
SELECT x.* FROM (call jdbc_source.native('insert into g1 (e1,e2) values (?, ?)', 112, 'foo')) w,
 ARRAYTABLE(w.tuple COLUMNS "update_count" integer) AS x
</pre>
</div></div>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Update Example</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
SELECT x.* FROM (call jdbc_source.native('update g1 set e2=? where e1 = ?','blah', 112)) w,
 ARRAYTABLE(w.tuple COLUMNS "update_count" integer) AS x
</pre>
</div></div>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Delete Example</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
SELECT x.* FROM (call jdbc_source.native('delete from g1 where e1 = ?', 112)) w,
 ARRAYTABLE(w.tuple COLUMNS "update_count" integer) AS x
</pre>
</div></div>

<h3><a name="JDBCTranslator-JCAResourceAdapter"></a>JCA Resource Adapter</h3>

<p>The resource adapter for this translator provided through data source in JBoss AS, Refer to Admin Guide for "JDBC Data Sources" configuration section.</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/JDBC+Translator">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=55477034&revisedVersion=21&originalVersion=20">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/JDBC+Translator?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>