没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Oracle® TimesTen In-Memory Database
Java Developer's Guide
11g Release 2 (11.2.2)
E21638-10
March 2015
Oracle TimesTen In-Memory Database Java Developer's Guide, 11g Release 2 (11.2.2)
E21638-10
Copyright © 1996, 2015, Oracle and/or its affiliates. All rights reserved.
This software and related documentation are provided under a license agreement containing restrictions on
use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your
license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,
transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse
engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is
prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If
you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it
on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software,
any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users
are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and
agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and
adaptation of the programs, including any operating system, integrated software, any programs installed on
the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to
the programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management
applications. It is not developed or intended for use in any inherently dangerous applications, including
applications that may create a risk of personal injury. If you use this software or hardware in dangerous
applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other
measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages
caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of
their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks
are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD,
Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced
Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content,
products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and
expressly disclaim all warranties of any kind with respect to third-party content, products, and services
unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its
affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of
third-party content, products, or services, except as set forth in an applicable agreement between you and
Oracle.
iii
Contents
Preface ................................................................................................................................................................ vii
Audience...................................................................................................................................................... vii
Related documents..................................................................................................................................... vii
Conventions ............................................................................................................................................... viii
Documentation Accessibility..................................................................................................................... ix
What's New........................................................................................................................................................ xi
New features in Release 11.2.2.0.0 ............................................................................................................ xi
1 Java Development Environment
Installing TimesTen and the JDK ......................................................................................................... 1-1
Setting the environment for Java development ................................................................................. 1-1
Compiling Java applications.................................................................................................................. 1-2
About the TimesTen Java demos .......................................................................................................... 1-2
2 Working with TimesTen Databases in JDBC
Key JDBC classes and interfaces........................................................................................................... 2-1
Package imports ................................................................................................................................. 2-2
Support for interfaces in the java.sql package ............................................................................... 2-2
Support for classes in the java.sql package .................................................................................... 2-4
Support for interfaces and classes in the javax.sql package......................................................... 2-4
TimesTen JDBC extensions............................................................................................................... 2-4
Additional TimesTen classes and interfaces .................................................................................. 2-6
Managing TimesTen database connections ........................................................................................ 2-6
Create a connection URL for the database and specify connection attributes.......................... 2-7
Connect to the database .................................................................................................................... 2-8
Disconnect from the database .......................................................................................................... 2-8
Open and close a direct connection................................................................................................. 2-9
Check database validity .................................................................................................................... 2-9
Access control for connections......................................................................................................... 2-9
Managing TimesTen data .................................................................................................................... 2-10
Executing simple SQL statements ................................................................................................ 2-10
Working with TimesTen result sets: hints and restrictions ...................................................... 2-11
Fetching multiple rows of data ..................................................................................................... 2-12
Binding parameters and executing statements........................................................................... 2-13
iv
Preparing SQL statements and setting input parameters.................................................. 2-13
Working with output and input/output parameters......................................................... 2-17
Binding duplicate parameters in SQL statements............................................................... 2-18
Binding duplicate parameters in PL/SQL ........................................................................... 2-20
Binding associative arrays...................................................................................................... 2-20
Working with REF CURSORs ....................................................................................................... 2-24
Working with DML returning (RETURNING INTO clause) ................................................... 2-25
Working with rowids ..................................................................................................................... 2-27
Working with LOBs ........................................................................................................................ 2-28
About LOBs............................................................................................................................... 2-28
LOB objects in JDBC ................................................................................................................ 2-28
Differences between TimesTen LOBs and Oracle Database LOBs................................... 2-29
LOB factory methods............................................................................................................... 2-30
LOB getter and setter methods .............................................................................................. 2-30
TimesTen LOB interface methods ......................................................................................... 2-31
LOB prefetching ....................................................................................................................... 2-32
Passthrough LOBs.................................................................................................................... 2-33
Committing or rolling back changes to the database ................................................................ 2-33
Setting autocommit.................................................................................................................. 2-33
Manually committing or rolling back changes.................................................................... 2-33
Using COMMIT and ROLLBACK SQL statements ............................................................ 2-34
Managing multiple threads ........................................................................................................... 2-34
Java escape syntax and SQL functions......................................................................................... 2-34
Using additional TimesTen data management features................................................................ 2-35
Using CALL to execute procedures and functions .................................................................... 2-35
Setting a timeout or threshold for executing SQL statements.................................................. 2-37
Setting a timeout duration for SQL statements ................................................................... 2-37
Setting a threshold duration for SQL statements................................................................ 2-37
Features for use with TimesTen Cache........................................................................................ 2-38
Setting temporary passthrough level with the ttOptSetFlag built-in procedure ........... 2-38
Managing cache groups .......................................................................................................... 2-39
Features for use with replication .................................................................................................. 2-39
Considering TimesTen features for access control......................................................................... 2-39
Handling errors...................................................................................................................................... 2-40
About fatal errors, non-fatal errors, and warnings .................................................................... 2-41
Handling fatal errors ............................................................................................................... 2-41
Handling non-fatal errors....................................................................................................... 2-41
About warnings.................................................................................................................
....... 2-41
Abnormal termination............................................................................................................. 2-42
Reporting errors and warnings..................................................................................................... 2-42
Catching and responding to specific errors ................................................................................ 2-43
Rolling back failed transactions .................................................................................................... 2-43
JDBC support for automatic client failover ..................................................................................... 2-44
Features and functionality of JDBC support for automatic client failover............................. 2-45
General Client Failover Features ........................................................................................... 2-45
Client failover features for pooled connections................................................................... 2-46
Configuration of automatic client failover .................................................................................. 2-46
v
Synchronous detection of automatic client failover................................................................... 2-46
Asynchronous detection of automatic client failover................................................................ 2-46
Implement a client failover event listener............................................................................ 2-47
Register the client failover listener instance......................................................................... 2-48
Remove the client failover listener instance......................................................................... 2-49
3 Using JMS/XLA for Event Management
JMS/XLA concepts.................................................................................................................................... 3-1
How XLA reads records from the transaction log ........................................................................ 3-2
XLA and materialized views............................................................................................................ 3-3
XLA bookmarks.................................................................................................................................. 3-4
How bookmarks work ............................................................................................................... 3-4
Replicated bookmarks................................................................................................................ 3-5
XLA bookmarks and transaction log holds............................................................................. 3-5
JMS/XLA configuration file and topics.......................................................................................... 3-6
XLA updates ....................................................................................................................................... 3-7
XLA acknowledgment modes.......................................................................................................... 3-8
Prefetching updates.................................................................................................................... 3-8
Acknowledging updates............................................................................................................ 3-9
Access control impact on XLA ......................................................................................................... 3-9
XLA limitations .................................................................................................................................. 3-9
JMS/XLA and Oracle GDK dependency.............................................................................................. 3-9
Connecting to XLA ................................................................................................................................ 3-10
Monitoring tables for updates ............................................................................................................ 3-10
Receiving and processing updates..................................................................................................... 3-11
Terminating a JMS/XLA application ................................................................................................. 3-14
Closing the connection ................................................................................................................... 3-14
Deleting bookmarks........................................................................................................................ 3-14
Unsubscribing from a table............................................................................................................ 3-14
Using JMS/XLA as a replication mechanism ................................................................................... 3-15
Applying JMS/XLA messages to a target database................................................................... 3-15
TargetDataStore error recovery .................................................................................................... 3-16
4 Distributed Transaction Processing: JTA
Overview of JTA....................................................................................................................................... 4-1
X/Open DTP model........................................................................................................................... 4-2
Two-phase commit............................................................................................................................. 4-2
Using JTA in TimesTen .......................................................................................................................... 4-3
TimesTen database requirements for XA ....................................................................................... 4-3
Global transaction recovery in TimesTen....................................................................................... 4-3
XA error handling in TimesTen....................................................................................................... 4-4
Using the JTA API.................................................................................................................................... 4-4
Required packages............................................................................................................................. 4-4
Creating a TimesTen XAConnection object ................................................................................... 4-4
Creating XAResource and Connection objects .............................................................................. 4-6
剩余111页未读,继续阅读
资源评论
weixin_40191861_zj
- 粉丝: 62
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功