JDBC in Teiid
Driver Connection
Teiid JDBC Driver Class is org.teiid.jdbc.TeiidDriver, use the following URL format for JDBC connections:
jdbc:teiid:<vdb-name>@mm[s]://<host>:<port>;[prop-name=prop-value;]
FetchSize Connection Properties
Teiid Support a series of Properties, refer to Teiid Document for details.
FetchSize
hints the size of the resultset, the default is 2048, which means, the resultset size is 2048. In this section, we will dive into details how FetchSize setting works in Teiid.
- In How a connection be created step, a
org.teiid.jdbc.ConnectionImpl
be created, Property FetchSize be set a to connectionProerties list. - In How a Statement execute the query setp,
org.teiid.jdbc.StatementImpl
FetchSize be extract from connectionProerties, parse to a integer, set toStatementImpl
’s fetchSize filed, which this occurr inStatementImpl
’s construct, then the FetchSize be sent toorg.teiid.client.RequestMessage
. - In How Teiid Server handle query request, Parse Message get the
org.teiid.client.RequestMessage
, invoke the DQPCore’s executeRequest(), FetchSize in RequestMessage be passed as a parameter. - In DQPCore’s executeRequest(),
RequestMessage
be sent to Request then be sent to RequestWorkItem, and base on FetchSize RequestWorkItem’sbegin
andend
be updated.