rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWDBPGSEnvironmentHandle Class Reference
[DB Access Module for PostgreSQL]

Provides methods for setting and retrieving certain connect time and configuration parameters with PostgreSQL. More...

#include <rw/db/pgssrc/pgsenvh.h>

Inheritance diagram for RWDBPGSEnvironmentHandle:
RWDBEnvironmentHandle

List of all members.

Public Member Functions

void connectTimeout (int value)
int connectTimeout () const
void serviceName (const RWCString &name)
RWCString serviceName () const
void binaryAsLo (bool flag)
bool binaryAsLo () const

Detailed Description

Class RWDBPGSEnvironmentHandle provides methods for setting and retrieving certain connect time and configuration parameters.

Please note that some connect time parameters are set only when a connection is established with the server. When the method returns a valid RWDBStatus for these parameters, it does not necessarily mean that the connection parameter has been accepted by the server. Appropriate error messages are fielded to the application only when a connection is established.

Note:
Use of this class reduces an application's portability.

Synopsis

 #include <rw/db/pgssrc/pgsenvh.h>

 RWDBPGSEnvironmentHandle* env =
       (RWDBPGSEnvironmentHandle*)myDatabase.environmentHandle();

Examples

The following example shows how to gain access to RWDBPGSEnvironmentHandle to set the connection timeout value. Note that the application must be compiled with an include path to the PostgreSQL libpq include files.

 #include <rw/db/pgssrc/pgsenvh.h>

 RWDBEnvironmentHandle* enH = adb.environmentHandle();
 RWDBPGSEnvironmentHandle* pgsH = (RWDBPGSEnvironmentHandle*)enH;

 pgsH->connectTimeout(30);

 RWDBConnection conn = adb.connection();

Member Function Documentation

bool RWDBPGSEnvironmentHandle::binaryAsLo (  )  const

Returns true if RWDBBlob should map to the user-defined datatype LO when selecting data or performing queries. The default is false.

void RWDBPGSEnvironmentHandle::binaryAsLo ( bool  flag  ) 

Sets a flag indicating that RWDBBlob should map to the user-defined datatype LO when selecting data or performing queries.

int RWDBPGSEnvironmentHandle::connectTimeout (  )  const

Returns the current value for the maximum number of seconds the PostgreSQL library waits for a login response when making a connection attempt.

void RWDBPGSEnvironmentHandle::connectTimeout ( int  value  ) 

Sets the maximum number of seconds that the PostgreSQL library should wait for a login response when making a connection attempt. The default is 0.

RWCString RWDBPGSEnvironmentHandle::serviceName (  )  const

Returns the service name that is to be used in the connect string passed to PQconnectdb().

void RWDBPGSEnvironmentHandle::serviceName ( const RWCString name  ) 

Sets the service name to be passed to PQconnectdb(). The service name holds additional connection parameters.

Please see the PostgreSQL documentation for details.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.