没有合适的资源?快使用搜索试试~ 我知道了~
首页Oracle 10g JDBC开发指南与参考:驱动应用的强大教程
Oracle® Database JDBC Developer's Guide and Reference 10g Release 1 (10.1) 是一本详细的指南,专为开发人员设计,旨在帮助他们利用Oracle JDBC驱动程序构建强大的Java数据库应用程序。该文档发布于2004年6月,版权归属于Oracle公司,享有1999年和2004年的版权。
本书的主要作者是Elizabeth Hanes Perry、Brian Wright和Thomas Pfaeffle,他们共同负责了核心内容的编写。其他贡献者包括Brian Martin,以及Kuassi Mensah、Magdi Morsi、Ron Peterson等多位技术专家,他们在特定章节或技术领域提供了深入的知识和实用案例。书中包含了丰富的编程示例、API解释、连接管理、数据操作、事务处理、错误处理、安全性等内容,全面覆盖了Oracle JDBC 10g Release 1的技术特性。
作为开发者工具,Oracle JDBC允许Java应用与Oracle数据库无缝交互,支持SQL语句执行、结果集处理、连接池管理和高级功能。使用这本书,读者可以学习如何设置数据库连接,执行CRUD操作(Create, Read, Update, Delete),实现事务控制,以及优化性能和安全性。此外,书中还涉及到了版权和许可协议,强调了软件和文档中的专有信息受限制使用和披露的规定,同时也受到版权法和专利保护。
Oracle® Database JDBC Developer's Guide and Reference 10g Release 1 是一个宝贵的资源库,对于任何希望在Java平台上利用Oracle数据库进行高效开发的工程师来说,都是不可或缺的学习材料。通过深入理解并实践书中的内容,开发者能够提升自己的数据库编程技能,并确保遵循Oracle的规范和最佳实践。
![](https://csdnimg.cn/release/download_crawler_static/5952495/bg10.jpg)
xvi
OCI Driver Transparent Application Failover................................................................................. 19-7
Failover Type Events ...................................................................................................................... 19-7
TAF Callbacks.................................................................................................................................. 19-8
Java TAF Callback Interface .......................................................................................................... 19-8
Handling the FO_ERROR Event............................................................................................ 19-9
Handling the FO_ABORT Event............................................................................................ 19-9
OCI HeteroRM XA ................................................................................................................................ 19-9
Configuration and Installation...................................................................................................... 19-9
Exception Handling........................................................................................................................ 19-9
HeteroRM XA Code Example ....................................................................................................... 19-9
Accessing PL/SQL Index-by Tables ................................................................................................. 19-10
Overview........................................................................................................................................ 19-10
Binding IN Parameters................................................................................................................. 19-11
Receiving OUT Parameters.......................................................................................................... 19-12
Registering the OUT Parameters......................................................................................... 19-12
Accessing the OUT Parameter Values ................................................................................ 19-13
JDBC Default Mappings ................................................................................................ 19-13
Oracle Mappings............................................................................................................. 19-14
Java Primitive Type Mappings ..................................................................................... 19-14
20 OCI Instant Client
Overview ................................................................................................................................................ 20-1
Benefits of Instant Client..................................................................................................................... 20-2
JDBC OCI Instant Client Installation Process................................................................................. 20-2
When to Use Instant Client ................................................................................................................. 20-3
Patching Instant Client Shared Libraries ......................................................................................... 20-3
Regeneration of Data Shared Library................................................................................................ 20-4
Database Connection Names for OCI Instant Client..................................................................... 20-4
Environment Variables for OCI Instant Client ............................................................................... 20-5
21 End-To-End Metrics Support
Introduction............................................................................................................................................ 21-1
JDBC API For End-To-End Metrics.................................................................................................... 21-2
22 Performance Extensions
Update Batching .................................................................................................................................... 22-1
Overview of Update Batching Models......................................................................................... 22-1
Oracle Model versus Standard Model.................................................................................. 22-2
Types of Statements Supported............................................................................................. 22-2
Oracle Update Batching ................................................................................................................. 22-3
Oracle Update Batching Characteristics and Limitations.................................................. 22-3
Setting the Connection Batch Value...................................................................................... 22-4
Setting the Statement Batch Value......................................................................................... 22-4
Checking the Batch Value....................................................................................................... 22-5
Overriding the Batch Value ................................................................................................... 22-5
Committing the Changes in Oracle Batching ...................................................................... 22-6
![](https://csdnimg.cn/release/download_crawler_static/5952495/bg11.jpg)
xvii
Update Counts in Oracle Batching........................................................................................ 22-6
Standard Update Batching............................................................................................................. 22-8
Limitations in the Oracle Implementation of Standard Batching..................................... 22-8
Adding Operations to the Batch............................................................................................ 22-8
Executing the Batch ................................................................................................................. 22-9
Committing the Changes in the Oracle Implementation of Standard Batching........... 22-10
Clearing the Batch.................................................................................................................. 22-10
Update Counts in the Oracle Implementation of Standard Batching ............................ 22-11
Error Handling in the Oracle Implementation of Standard Batching............................ 22-12
Intermixing Batched Statements and Non-Batched Statements ..................................... 22-13
Premature Batch Flush ................................................................................................................. 22-13
Additional Oracle Performance Extensions................................................................................... 22-14
Oracle Row Prefetching................................................................................................................ 22-15
Setting the Oracle Prefetch Value........................................................................................ 22-15
Oracle Row-Prefetching Limitations................................................................................... 22-17
Defining Column Types............................................................................................................... 22-17
DatabaseMetaData TABLE_REMARKS Reporting.................................................................. 22-19
Considerations for getProcedures() and getProcedureColumns() Methods................. 22-20
23 JDBC Client-Side Security Features
JDBC Support for Oracle Advanced Security.................................................................................. 23-1
OCI Driver Support for Oracle Advanced Security................................................................... 23-1
Thin Driver Support for Oracle Advanced Security.................................................................. 23-2
JDBC Support for Login Authentication.......................................................................................... 23-2
JDBC Support for Data Encryption and Integrity .......................................................................... 23-2
OCI Driver Support for Encryption and Integrity ..................................................................... 23-3
Thin Driver Support for Encryption and Integrity .................................................................... 23-4
Setting Encryption and Integrity Parameters in Java ................................................................ 23-5
Complete example ................................................................................................................... 23-6
24 JDBC in Applets
Connecting to the Database through the Applet ............................................................................ 24-1
Connecting to a Database on a Different Host Than the Web Server......................................... 24-2
Using the Oracle Connection Manager........................................................................................ 24-2
Installing and Running the Oracle Connection Manager .................................................. 24-3
Writing the URL that Targets the Connection Manager.................................................... 24-4
Connecting through Multiple Connection Managers......................................................... 24-4
Using Signed Applets..................................................................................................................... 24-4
Using Applets with Firewalls ............................................................................................................ 24-5
Configuring a Firewall for Applets that use the JDBC Thin Driver ........................................ 24-5
Writing a URL to Connect through a Firewall............................................................................ 24-6
Packaging Applets................................................................................................................................. 24-7
Specifying an Applet in an HTML Page........................................................................................... 24-8
CODE, HEIGHT, and WIDTH ...................................................................................................... 24-8
CODEBASE...................................................................................................................................... 24-8
ARCHIVE......................................................................................................................................... 24-8
![](https://csdnimg.cn/release/download_crawler_static/5952495/bg12.jpg)
xviii
25 Reference Information
Valid SQL-JDBC Datatype Mappings............................................................................................... 25-1
Supported SQL and PL/SQL Datatypes............................................................................................ 25-3
Embedded SQL92 Syntax .................................................................................................................... 25-7
Disabling Escape Processing ......................................................................................................... 25-7
Time and Date Literals ................................................................................................................... 25-7
Date Literals.............................................................................................................................. 25-7
Time Literals............................................................................................................................. 25-8
Timestamp Literals .................................................................................................................. 25-8
Scalar Functions............................................................................................................................... 25-9
LIKE Escape Characters ................................................................................................................. 25-9
Outer Joins...................................................................................................................................... 25-10
Function Call Syntax..................................................................................................................... 25-10
SQL92 to SQL Syntax Example ................................................................................................... 25-10
Oracle JDBC Notes and Limitations................................................................................................ 25-11
CursorName................................................................................................................................... 25-11
SQL92 Outer Join Escapes............................................................................................................ 25-11
PL/SQL TABLE, BOOLEAN, and RECORD Types ................................................................ 25-11
IEEE 754 Floating Point Compliance.......................................................................................... 25-11
Catalog Arguments to DatabaseMetaData Calls...................................................................... 25-12
SQLWarning Class........................................................................................................................ 25-12
Binding Named Parameters ........................................................................................................ 25-12
Retaining Bound Values ....................................................................................................... 25-12
26 Server-Side Internal Driver
Introduction............................................................................................................................................ 26-1
Connecting to the Database with the Server-Side Internal Driver ............................................. 26-1
Connecting with the OracleDriver Class defaultConnection() Method ................................. 26-2
Connecting with the OracleDataSource.getConnection() Method .......................................... 26-3
Exception-Handling Extensions for the Server-Side Internal Driver ......................................... 26-3
Example ............................................................................................................................................ 26-4
Session and Transaction Context for the Server-Side Internal Driver........................................ 26-4
Testing JDBC on the Server................................................................................................................. 26-4
Loading an Application into the Server............................................................................................ 26-5
Loading Class Files into the Server .............................................................................................. 26-5
Loading Source Files into the Server............................................................................................ 26-6
Server-Side Character Set Conversion of oracle.sql.CHAR Data ................................................ 26-6
27 Proxy Authentication
Middle-Tier Authentication Through Proxy Connections............................................................ 27-1
28 Coding Tips and Troubleshooting
JDBC and Multithreading ................................................................................................................... 28-1
Performance Optimization .................................................................................................................. 28-4
Disabling Auto-Commit Mode ..................................................................................................... 28-4
Example: Disabling AutoCommit ........................................................................................ 28-5
![](https://csdnimg.cn/release/download_crawler_static/5952495/bg13.jpg)
xix
Standard Fetch Size and Oracle Row Prefetching...................................................................... 28-5
Standard and Oracle Update Batching ........................................................................................ 28-5
Mapping Between Built-in SQL and Java Types........................................................................ 28-6
Common Problems................................................................................................................................ 28-7
Memory Consumption for CHAR Columns Defined as OUT or IN/OUT Variables.......... 28-7
Memory Leaks and Running Out of Cursors.............................................................................. 28-7
Boolean Parameters in PL/SQL Stored Procedures................................................................... 28-7
Opening More Than 16 OCI Connections for a Process............................................................ 28-8
Using statement.cancel() ................................................................................................................ 28-8
Basic Debugging Procedures .............................................................................................................. 28-9
Oracle Net Tracing to Trap Network Events .............................................................................. 28-9
Client-Side Tracing ............................................................................................................... 28-10
TRACE_LEVEL_CLIENT ............................................................................................. 28-10
TRACE_DIRECTORY_CLIENT ................................................................................... 28-10
TRACE_FILE_CLIENT .................................................................................................. 28-10
TRACE_UNIQUE_CLIENT ......................................................................................... 28-11
Server-Side Tracing ............................................................................................................... 28-11
TRACE_LEVEL_SERVER ............................................................................................. 28-11
TRACE_DIRECTORY_SERVER .................................................................................. 28-11
TRACE_FILE_SERVER.................................................................................................. 28-11
Third Party Debugging Tools ..................................................................................................... 28-12
Transaction Isolation Levels and Access Modes ........................................................................... 28-12
A JDBC Error Messages
General Structure of JDBC Error Messages ....................................................................................... A-1
General JDBC Messages ........................................................................................................................ A-1
JDBC Messages Sorted by ORA Number...................................................................................... A-1
JDBC Messages Sorted Alphabetically........................................................................................... A-5
HeteroRM XA Messages ........................................................................................................................ A-9
HeteroRM XA Messages Sorted by ORA Number ...................................................................... A-9
HeteroRM XA Messages Sorted Alphabetically........................................................................... A-9
TTC Messages ........................................................................................................................................ A-10
TTC Messages Sorted by ORA Number...................................................................................... A-10
TTC Messages Sorted Alphabetically........................................................................................... A-11
Index
![](https://csdnimg.cn/release/download_crawler_static/5952495/bg14.jpg)
xx
List of Tables
3–1 Standard Datasource Properties .............................................................................................. 3-3
3–2 Oracle Extended Datasource Properties................................................................................. 3-4
3–3 Supported Database Specifiers ................................................................................................ 3-9
4–1 Import Statements for JDBC Driver ........................................................................................ 4-2
4–2 Connection Properties Recognized by Oracle JDBC Drivers .............................................. 4-3
4–3 Default Mappings Between SQL Types and Java Types................................................... 4-12
4–4 LONG and LONG RAW Data Conversions ....................................................................... 4-16
4–5 Bind-Size Limitations By........................................................................................................ 4-22
5–1 JDBC 3.0 Feature Support......................................................................................................... 5-3
5–2 Key Areas of JDBC 3.0 Functionality ...................................................................................... 5-3
5–3 BLOB Method Equivalents....................................................................................................... 5-7
5–4 CLOB Method Equivalents....................................................................................................... 5-7
6–1 Comparing Methods Used in Statement Caching................................................................. 6-3
6–2 Methods Used in Statement Allocation and Implicit Statement Caching......................... 6-6
6–3 Methods Used to Retrieve Explicitly Cached Statements.................................................... 6-8
8–1 onsctl commands........................................................................................................................ 8-3
9–1 Connection Mode Transitions.................................................................................................. 9-4
9–2 Oracle-XA Error Mapping..................................................................................................... 9-14
10–1 Oracle Datatype Classes......................................................................................................... 10-5
10–2 Key Interfaces and Classes of the oracle.jdbc Package.................................................... 10-11
11–1 getObject() and getOracleObject() Return Types ............................................................... 11-5
11–2 Summary of getXXX() Return Types.................................................................................... 11-6
11–3 Summary of setXXX() Input Parameter Types ................................................................... 11-9
11–4 Size Limitations for setBytes() and setString() Methods................................................. 11-11
13–1 JPublisher SQL Type Categories, Supported Settings, and Defaults ............................ 13-34
17–1 Visibility of Internal and External Changes for Oracle JDBC......................................... 17-19
18–1 The JDBC and Cached Row Sets Compared....................................................................... 18-8
19–1 PL/SQL Types and Corresponding JDBC Types............................................................. 19-10
19–2 Arguments of the setPlsqlIndexTable () Method ............................................................. 19-11
19–3 Arguments of the registerIndexTableOutParameter () Method .................................... 19-12
19–4 Argument of the getPlsqlIndexTable () Method .............................................................. 19-13
19–5 Argument of the getOraclePlsqlIndexTable () Method................................................... 19-14
19–6 Arguments of the getPlsqlIndexTable () Method............................................................. 19-15
20–1 OCI Instant Client Shared Libraries..................................................................................... 20-1
21–1 Maximum Lengths for End-to-End Metrics........................................................................ 21-1
22–1 Valid Column Type Specifications..................................................................................... 22-19
23–1 Client/Server Negotiations for Encryption or Integrity ................................................... 23-3
23–2 OCI Driver Client Parameters for Encryption and Integrity............................................ 23-4
23–3 Thin Driver Client Parameters for Encryption and Integrity........................................... 23-5
25–1 Valid SQL Datatype-Java Class Mappings.......................................................................... 25-1
25–2 Support for SQL Datatypes ................................................................................................... 25-3
25–3 Support for ANSI-92 SQL Datatypes................................................................................... 25-4
25–4 Support for SQL User-Defined Types.................................................................................. 25-5
25–5 Support for PL/SQL Datatypes............................................................................................ 25-5
28–1 Mapping of SQL Datatypes to Java Classes that Represent SQL Datatypes.................. 28-6
剩余431页未读,继续阅读
oracle database jdbc developer's guide and reference 10g release1(10/1) part no. B10979-02 June 2004
2009-08-17 上传
2023-06-08 上传
2024-01-31 上传
2023-05-27 上传
2023-07-28 上传
2023-05-16 上传
2023-03-16 上传
2023-06-11 上传
![](https://profile-avatar.csdnimg.cn/c7bef69afc0d442880bfa0e8f0ceb0f9_striker925.jpg!1)
Striker925
- 粉丝: 19
- 资源: 10
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- 解决本地连接丢失无法上网的问题
- BIOS报警声音解析:故障原因与解决方法
- 广义均值移动跟踪算法在视频目标跟踪中的应用研究
- C++Builder快捷键大全:高效编程的秘密武器
- 网页制作入门:常用代码详解
- TX2440A开发板网络远程监控系统移植教程:易搭建与通用解决方案
- WebLogic10虚拟内存配置详解与优化技巧
- C#网络编程深度解析:Socket基础与应用
- 掌握Struts1:Java MVC轻量级框架详解
- 20个必备CSS代码段提升Web开发效率
- CSS样式大全:字体、文本、列表样式详解
- Proteus元件库大全:从基础到高级组件
- 74HC08芯片:高速CMOS四输入与门详细资料
- C#获取当前路径的多种方法详解
- 修复MySQL乱码问题:设置字符集为GB2312
- C语言的诞生与演进:从汇编到系统编程的革命
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)