SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches

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

#include <rw/db/mysrc/mysenvh.h>

Inheritance diagram for RWDBMySqlLibEnvironmentHandle:
RWDBEnvironmentHandle

Public Member Functions

unsigned int loginTimeout () const
 
RWDBStatus loginTimeout (unsigned int value)
 
size_t maxBlobSize () const
 
RWDBStatus maxBlobSize (size_t rVal)
 
size_t maxStringSize () const
 
RWDBStatus maxStringSize (size_t rVal)
 
RWCString nationalLanguage () const
 
- Public Member Functions inherited from RWDBEnvironmentHandle
 RWDBEnvironmentHandle ()
 
bool cacheResultSchemas () const
 
bool cacheResultSchemas (bool value)
 
virtual bool foreignKeysFromView ()
 
virtual bool foreignKeysFromView (bool value)
 
size_t maxCachedResultSets () const
 
size_t maxCachedResultSets (size_t value)
 

Detailed Description

Class RWDBMySqlLibEnvironmentHandle 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 will be fielded to the application only when a connection is established.

Note
Use of this class reduces an application's portability.
Synopsis
#include <rw/db/mysrc/mysenvh.h>
(RWDBMySqlLibEnvironmentHandle*)myDatabase.environmentHandle();
Provides methods for setting and retrieving certain connect time and configuration parameters with My...
Definition mysenvh.h:68
Example
The following example shows how to gain access to RWDBMySqlLibEnvironmentHandle. Note that the application must be compiled with an include path to the MySQL library include files.
#include <rw/db/myssrc/mysenvh.h>
RWDBEnvironmentHandle* enH = adb.environmentHandle();
// Set the login timeout
mysH->loginTimeout(30);
// Get Connection
RWDBConnection conn = adb.connection();
Represents an explicit database connection object that can be used in place of the implicit database ...
Definition connect.h:81
Abstract base class from which all vendor-specific environment handles must derive....
Definition envhandl.h:64
unsigned int loginTimeout() const

Member Function Documentation

◆ loginTimeout() [1/2]

unsigned int RWDBMySqlLibEnvironmentHandle::loginTimeout ( ) const

Returns the current value for the maximum number of seconds to wait for a login response when making a connection attempt. The default value is 0 seconds, which means the connection attempt may wait indefinitely.

◆ loginTimeout() [2/2]

RWDBStatus RWDBMySqlLibEnvironmentHandle::loginTimeout ( unsigned int value)

Sets the maximum number of seconds to wait for a login response when making a connection attempt.

◆ maxBlobSize() [1/2]

size_t RWDBMySqlLibEnvironmentHandle::maxBlobSize ( ) const

Returns the maximum byte length of blobs retrieved. The default is 128,000.

◆ maxBlobSize() [2/2]

RWDBStatus RWDBMySqlLibEnvironmentHandle::maxBlobSize ( size_t rVal)

Sets the maximum byte length of blobs retrieved, to rVal, and returns an RWDBStatus indicating whether the operation succeeded.

If the size of the blob data column being fetched is greater than the value last set, then an attempt is made to fetch the data in parts. If this is not possible, then the data is truncated to rVal bytes.

◆ maxStringSize() [1/2]

size_t RWDBMySqlLibEnvironmentHandle::maxStringSize ( ) const

Returns the maximum length, in code units, of strings retrieved. The default is 128,000.

◆ maxStringSize() [2/2]

RWDBStatus RWDBMySqlLibEnvironmentHandle::maxStringSize ( size_t rVal)

Sets the maximum length, in code units, of strings retrieved, to rVal, and returns an RWDBStatus indicating whether the operation succeeded.

If the size of the string data column being fetched is greater than the value last set, then an attempt is made to fetch the data in parts. If this is not possible, then the data is truncated to rVal code units.

◆ nationalLanguage()

RWCString RWDBMySqlLibEnvironmentHandle::nationalLanguage ( ) const

Returns the national language, or character set, that the database server is currently using.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.