SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Provides methods for setting and retrieving certain connect time and configuration parameters with MySQL. More...
#include <rw/db/mysrc/mysenvh.h>
Public Member Functions | |
unsigned int | loginTimeout () const |
RWDBStatus | loginTimeout (unsigned int value) |
RWCString | nationalLanguage () const |
size_t | maxBlobSize () const |
RWDBStatus | maxBlobSize (size_t rVal) |
size_t | maxStringSize () const |
RWDBStatus | maxStringSize (size_t rVal) |
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.
#include <rw/db/mysrc/mysenvh.h> RWDBMySqlLibEnvironmentHandle* env = (RWDBMySqlLibEnvironmentHandle*)myDatabase.environmentHandle();
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(); RWDBMySqlLibEnvironmentHandle* mysH = (RWDBMySqlLibEnvironmentHandle*)enH; // Set the login timeout mysH->loginTimeout(30); // Get Connection RWDBConnection conn = adb.connection();
RWDBStatus RWDBMySqlLibEnvironmentHandle::loginTimeout | ( | unsigned int | value | ) |
Sets the maximum number of seconds to wait for a login response when making a connection attempt.
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.
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.
size_t RWDBMySqlLibEnvironmentHandle::maxBlobSize | ( | ) | const |
Returns the maximum byte length of blobs retrieved. The default is 128,000.
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.
size_t RWDBMySqlLibEnvironmentHandle::maxStringSize | ( | ) | const |
Returns the maximum length, in code units, of strings retrieved. The default is 128,000.
RWCString RWDBMySqlLibEnvironmentHandle::nationalLanguage | ( | ) | const |
Returns the national language, or character set, that the database server is currently using.
© 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.