搜索

此内容没有您所选择的语言版本。

Chapter 3. Extensions to JDBC

download PDF

3.1. Prepared Statements

JBoss Data Virtualization provides org.teiid.jdbc.TeiidPreparedStatement, a custom interface for the standard java.sql.PreparedStatement, and implementations org.teiid.jdbc.CallableStatementImpl and org.teiid.jdbc.PreparedStatementImpl. Prepared statements can be important in speeding up common statement execution, since they allow the server to skip parsing, resolving, and planning of the statement.
The following points should be considered when using prepared statements:
  • It is not necessary to pool client-side JBoss Data Virtualization prepared statements, because JBoss Data Virtualization performs plan caching on the server side.
  • The number of cached plans is configurable. The plans are purged in order of least recently used (LRU).
  • Cached plans are not distributed through a cluster. A new plan must be created for each cluster member.
  • Plans are cached for the entire VDB or for just a particular session. The scope of a plan is detected automatically based upon the functions evaluated during its planning process.
  • Runtime updates of costing information do not yet cause re-planning. At this time only session-scoped temporary table or internally materialized tables update their costing information.
  • Stored procedures executed through a callable statement have their plans cached in the same way as a prepared statement.
  • Bind variable types in function signatures, for example where t.col = abs(?), can be determined if the function has only one signature or if the function is used in a predicate where the return type can be determined. In more complex situations it may be necessary to add a type hint with a cast or convert, for example upper(convert(?, string)).
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.