Skip Headers

Oracle C++ Call Interface Programmer's Guide
Release 2 (9.2)

Part Number A96583-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

OCCI Classes and Methods, 6 of 22


Connection Class

The Connection class represents a connection with a specific database. Within the context of a connection, SQL statements are executed and results are returned.

To create a connection, use the syntax:

Connection();

Summary of Connection Methods

Table 8-6 Connection Methods  
Method Summary

changePassword()

Change the password for the current user.

commit()

Commit changes made since the previous commit or rollback and release any database locks held by the session.

createStatement()

Create a Statement object to execute SQL statements.

flushCache()

Flush the object cache associated with the connection.

getClientCharSet()

Return the default client character set.

getClientNCHARCharSet()

Return the default client NCHAR character set.

getMetaData()

Return the metadata for an object accessible from the connection.

getOCIServer()

Return the OCI server context associated with the connection.

getOCIServiceContext()

Return the OCI service context associated with the connection.

getOCISession()

Return the OCI session context associated with the connection.

rollback()

Roll back all changes made since the previous commit or rollback and release any database locks held by the session.

terminateStatement()

Close a Statement object and free all resources associated with it.

changePassword()

This method changes the password of the user currently connected to the database.

Syntax
void changePassword(const string &user,
   const string &oldPassword,
   const string &newPassword);
Parameters
user

The user currently connected to the database.

oldPassword

The current password of the user.

newPassword

The new password of the user.

commit()

This method commits all changes made since the previous commit or rollback, and releases any database locks currently held by the session.

Syntax
void commit();

createStatement()

This method creates a Statement object with the SQL statement specified.

Syntax
Statement* createStatement(const string &sql ="");
Parameters
sql

The SQL string to be associated with the statement object.

flushCache()

This method flushes the object cache associated with the connection.

Syntax
void flushCache();

getClientCharSet()

This method returns the session's character set.

Syntax
string getClientCharSet() const;

getClientNCHARCharSet()

This method returns the session's NCHAR character set.

Syntax
string getClientNCHARCharSet() const;

getMetaData()

This method returns metadata for an object in the database.

Syntax

There are variants of syntax:

MetaData getMetaData(const string &object,
   MetaData::ParamType prmtyp = MetaData::PTYPE_UNK) const;
MetaData getMetaData(const RefAny &ref) const;
Parameters
object

The schema object to be described.

prmtyp

The type of the schema object being described. The possible values for this are enumerated by MetaData::ParamType.

Valid values are:

PTYPE_TABLE--table

PTYPE_VIEW--view

PTYPE_PROC--procedure

PTYPE_FUNC--function

PTYPE_PKG--package

PTYPE_TYPE--type

PTYPE_TYPE_ATTR--attribute of a type

PTYPE_TYPE_COLL--collection type information

PTYPE_TYPE_METHOD--a method of a type

PTYPE_SYN--synonym

PTYPE_SEQ--sequence

PTYPE_COL--column of a table or view

PTYPE_ARG--argument of a function or procedure

PTYPE_TYPE_ARG--argument of a type method

PTYPE_TYPE_RESULT--the results of a method

PTYPE_SCHEMA--schema

PTYPE_DATABASE--database

PTYPE_UNK--type unknown

ref

A REF to the Type Descriptor Object (TDO) of the type to be described.

getOCIServer()

This method returns the OCI server context associated with the connection.

Syntax
LNOCIServer* getOCIServer() const;

getOCIServiceContext()

This method returns the OCI service context associated with the connection.

Syntax
LNOCISvcCtx* getOCIServiceContext() const;

getOCISession()

This method returns the OCI session context associated with the connection.

Syntax
LNOCISession* getOCISession() const;

rollback()

This method drops all changes made since the previous commit or rollback, and releases any database locks currently held by the session.

Syntax
void rollback();

terminateStatement()

This method closes a Statement object and frees all resources associated with it.

Syntax
void terminateStatement(Statement *statement);
Parameters
statement

The Statement to be closed.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback