没有合适的资源?快使用搜索试试~ 我知道了~
首页occi API C/C++
occi API C/C++

occi api 每个类都有详细说明,比较详尽 开发神器 包含C++调用的所有接口
资源详情
资源评论
资源推荐

Oracle® C++ Call Interface
Programmer's Guide
10g Release 2 (10.2)
B14294-02
December 2005

Oracle C++ Call Interface Programmer’s Guide, 10g Release 2 (10.2)
B14294-02
Copyright © 1999, 2005, Oracle. All rights reserved.
Primary Author: Roza Leyderman
Contributors: Sandeepan Banerjee, Subhranshu Banergee, Kalyanji Chintakayala, Krishna Itikarlapalli,
Shankar Iyer, Maura Joglekar, Toliver Jue, Ravi Kasamsetty, Srinath Krishnaswamy, Shoaib Lari, Geoff Lee,
Chetan Maiya, Rekha Vallam
The Programs (which include both the software and documentation) contain proprietary information; they
are provided under a license agreement containing restrictions on use and disclosure and are also protected
by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly,
or decompilation of the Programs, except to the extent required to obtain interoperability with other
independently created software or as specified by law, is prohibited.
The information contained in this document is subject to change without notice. If you find any problems in
the documentation, please report them to us in writing. This document is not warranted to be error-free.
Except as may be expressly permitted in your license agreement for these Programs, no part of these
Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose.
If the Programs are delivered to the United States Government or anyone licensing or using the Programs on
behalf of the United States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data
delivered to U.S. Government customers are "commercial computer software" or "commercial technical data"
pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As
such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation
and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license
agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial
Computer Software—Restricted Rights (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City,
CA 94065
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy and other measures to ensure the safe use of such applications if the Programs are used for such
purposes, and we disclaim liability for any damages caused by such use of the Programs.
Oracle, JD Edwards, PeopleSoft, and Retek are registered trademarks of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
The Programs may provide links to Web sites and access to content, products, and services from third
parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites.
You bear all risks associated with the use of such content. If you choose to purchase any products or services
from a third party, the relationship is directly between you and the third party. Oracle is not responsible for:
(a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the
third party, including delivery of products or services and warranty obligations related to purchased
products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from
dealing with any third party.

iii
Contents
List of Examples
List of Figures
List of Table s
Preface ............................................................................................................................................................. xxxi
Audience................................................................................................................................................... xxxi
Documentation Accessibility................................................................................................................. xxxi
Related Documents ................................................................................................................................ xxxii
Conventions ............................................................................................................................................ xxxii
What's New in Oracle C++ Call lnterface?............................................................................... xxxiii
New Features for Oracle Database 10g Release 2 (10.2) .................................................................. xxxiii
New Features for Oracle Database 10g Release 1 (10.1) .................................................................. xxxiv
1 Introduction to OCCI
Overview of OCCI ................................................................................................................................... 1-1
Benefits of OCCI................................................................................................................................. 1-2
Building an OCCI Application......................................................................................................... 1-2
Functionality of OCCI ....................................................................................................................... 1-2
Procedural and Nonprocedural Elements...................................................................................... 1-3
Processing of SQL Statements............................................................................................................... 1-3
DDL Statements.................................................................................................................................. 1-4
Control Statements............................................................................................................................. 1-4
DML SQL Statements ........................................................................................................................ 1-4
Queries................................................................................................................................................. 1-5
Overview of PL/SQL ............................................................................................................................... 1-5
Special OCCI/SQL Terms ....................................................................................................................... 1-6
Object Support.......................................................................................................................................... 1-7
Client-Side Object Cache................................................................................................................... 1-7
Runtime Environment for Objects................................................................................................... 1-8
Associative and Navigational Interfaces ........................................................................................ 1-8
Metadata Class.................................................................................................................................... 1-8
Object Type Translator Utility.......................................................................................................... 1-9
2 Installation and Upgrading
Installing Oracle C++ Call Interface..................................................................................................... 2-1
Upgrading Considerations ..................................................................................................................... 2-1

iv
Determining Client and Server Versions............................................................................................. 2-1
Instant Client............................................................................................................................................. 2-2
Benefits of Instant Client ................................................................................................................... 2-2
Installing Instant Client..................................................................................................................... 2-2
Oracle Technology Network ..................................................................................................... 2-2
Complete Client Installation...................................................................................................... 2-3
Oracle Universal Installer .......................................................................................................... 2-3
Instant Client CD......................................................................................................................... 2-4
Using Instant Client ........................................................................................................................... 2-4
Patching Instant Client Shared Libraries on Unix......................................................................... 2-4
Regenerating the Data Shared Library and Zip Files ................................................................... 2-4
Database Connection Names for Instant Client............................................................................. 2-5
Environment Variables for OCCI Instant Client ........................................................................... 2-5
Instant Client Light (English) ................................................................................................................ 2-6
Globalization Settings for Instant Client Light (English) ............................................................. 2-6
Using Instant Client Light (English)................................................................................................ 2-7
Installing Instant Client Light (English) ......................................................................................... 2-7
Oracle Technology Network Download.................................................................................. 2-7
Client Admin Install ................................................................................................................... 2-7
Oracle Universal Installer .......................................................................................................... 2-8
Using OCCI with Microsoft Visual C++.............................................................................................. 2-8
3 Relational Programming
Connecting to a Database ....................................................................................................................... 3-1
Creating and Terminating an Environment................................................................................... 3-1
Opening and Closing a Connection ................................................................................................ 3-2
Pooling Connections................................................................................................................................ 3-3
Creating a Connection Pool .............................................................................................................. 3-3
Creating a Connection Pool....................................................................................................... 3-3
Proxy Connections...................................................................................................................... 3-4
Stateless Connection Pooling............................................................................................................ 3-5
Executing SQL DDL and DML Statements......................................................................................... 3-8
Creating a Statement Object ............................................................................................................. 3-8
Creating a Statement Object to Execute SQL Commands ........................................................... 3-8
Creating a Database Table ......................................................................................................... 3-8
Inserting Values into a Database Table.................................................................................... 3-9
Reusing a Statement Object .............................................................................................................. 3-9
Terminating a Statement Object....................................................................................................... 3-9
Types of SQL Statements in the OCCI Environment........................................................................ 3-9
Standard Statements .......................................................................................................................... 3-9
Parameterized Statements.............................................................................................................. 3-10
Callable Statements......................................................................................................................... 3-10
Callable Statements with Arrays as Parameters.................................................................. 3-11
Streamed Reads and Writes........................................................................................................... 3-11
Binding Data in a Streaming Mode; SELECT/DML and PL/SQL................................... 3-12
Fetching Data in a Streaming Mode: PL/SQL..................................................................... 3-13
Fetching Data in Streaming Mode: ResultSet ...................................................................... 3-13

v
Working with Multiple Streams ............................................................................................ 3-13
Modifying Rows Iteratively........................................................................................................... 3-14
Setting the Maximum Number of Iterations........................................................................ 3-15
Setting the Maximum Parameter Size................................................................................... 3-15
Executing an Iterative Operation........................................................................................... 3-15
Iterative Execution Usage Notes ........................................................................................... 3-15
Executing SQL Queries ........................................................................................................................ 3-15
Result Set .......................................................................................................................................... 3-16
Specifying the Query ...................................................................................................................... 3-16
Optimizing Performance by Setting Prefetch Count ................................................................. 3-17
Executing Statements Dynamically ................................................................................................... 3-17
Status Definitions ............................................................................................................................ 3-18
UNPREPARED......................................................................................................................... 3-18
PREPARED ............................................................................................................................... 3-18
RESULT_SET_AVAILABLE................................................................................................... 3-18
UPDATE_COUNT_AVAILABLE.......................................................................................... 3-19
NEEDS_STREAM_DATA....................................................................................................... 3-19
STREAM_DATA_AVAILABLE............................................................................................. 3-19
Committing a Transaction.................................................................................................................... 3-20
Caching Statements............................................................................................................................... 3-20
Handling Exceptions............................................................................................................................. 3-22
Handling Null and Truncated Data ............................................................................................. 3-23
4 Object Programming
Overview of Object Programming........................................................................................................ 4-1
Working with Objects in OCCI............................................................................................................. 4-2
Persistent Objects ............................................................................................................................... 4-2
Transient Objects................................................................................................................................ 4-3
Values................................................................................................................................................... 4-4
Representing Objects in C++ Applications ........................................................................................ 4-4
Creating Persistent and Transient Objects ..................................................................................... 4-4
Creating Object Representations using the OTT Utility............................................................... 4-4
Developing an OCCI Object Application ........................................................................................... 4-5
Basic Object Program Structure ....................................................................................................... 4-5
Basic Object Operational Flow ......................................................................................................... 4-6
Initialize OCCI in Object Mode................................................................................................. 4-7
Pin Object ..................................................................................................................................... 4-8
Operate on Object in Cache ...................................................................................................... 4-8
Flush Changes to Object............................................................................................................. 4-8
Deletion of an Object .................................................................................................................. 4-9
Migrating C++ Applications Using OCCI........................................................................................... 4-9
Steps for Migration ............................................................................................................................ 4-9
Overview of Associative Access............................................................................................................ 4-9
Using SQL to Access Objects............................................................................................................ 4-9
Inserting and Modifying Values ................................................................................................... 4-10
Overview of Navigational Access ...................................................................................................... 4-10
Retrieving an Object Reference (REF) from the Database Server ........................................... 4-10
剩余473页未读,继续阅读









安全验证
文档复制为VIP权益,开通VIP直接复制

评论1