Oracle Objects for OLE C++ Class Library
Release 9.0.1

Part Number A90172-01

Home

Book List

Contents

Master Index

Feedback

GetDatabase Method

Applies To

OBinder

ODynaset

OSqlStmt

ODatabaseCollection

Description

This method returns the associated database object by way of an ODatabase handle.

Usage

ODatabase GetDatabase(void) const

Remarks

Given an Odynaset, Obinder, or an OSqlStmt object, you can obtain an ODatabase object, which you can then use to access the Odynaset's, Obinder's, or OSqlStmt
s database. Note that this does not create another database object; rather, it returns another ODatabase that is a handle for an already existing database object.

Return Value

An ODatabase, which will be open on success, closed on failure.

Example

This example assumes that we have been working with an ODynaset object and now we want to execute a general SQL statement on the database.

// we've got an open ODynaset named workdyn

// get an ODatabase from workdyn

ODatabase workdb = workdyn.GetDatabase();

// now execute an SQL statement

workdb.ExecuteSQL("drop table tempwork");

// to do just one thing, we don't even need an ODatabase instance

// so we could have said

workdyn.GetDatabase().ExecuteSQL("drop table tempwork");


 
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.

Home

Book List

Contents