The DB Access Module for MySQL returns an environment handle that has the type RWDBMySqlLibEnvironmentHandle. This handle provides methods that an application can use to set or retrieve certain connect time and configuration parameters.
Connect time parameters are not set until a connection is established with the server. When a method returns a valid RWDBStatus, it doesn't necessarily mean that the connection parameter was accepted by the server. Appropriate error messages are fielded to the application only when a connection is established.
The loginTimeout() method sets the number of seconds a login request waits to complete before returning to the calling application. Two loginTimeout() methods are available:
unsigned int loginTimeout() const; RWDBStatus loginTimeout(unsigned int value);
The default is 0, meaning an infinite timeout period and a connection attempt will wait indefinitely.
The nationalLanguage() method returns the character set that the database server is currently using:
RWCString nationalLanguage() const;
The maxBlobSize() method sets the maximum size for blobs that can be read by a scrolling RWDBCursor. Two methods are defined:
size_t maxBlobSize() const; RWDBStatus maxBlobSize(size_t bSize);
Maximum blob size can be set explicitly if using a scrolling RWDBCursor with an RWDBBlob. See Section 2.5, "Cursors." Sequential cursors are not restricted.
The maxBlobSize methods are deprecated. They exist for backward compatibility.
NOTE -- The maxStringSize methods are deprecated. They exist for backward compatibility.
The maxStringSize() method sets the maximum size for strings that can be read by a scrolling RWDBCursor. Two methods are defined:
size_t maxStringSize() const; RWDBStatus maxStringSize(size_t bSize);
Maximum string size can be set explicitly if using a scrolling RWDBCursor with a large string. See Section 2.5, "Cursors." Sequential cursors are not restricted.
The DB Access Module for MySQL has not implemented the virtual functions foreignKeysFromView() and foreignKeysFromView(bool value).
Both functions are therefore no-ops which return false.
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();
© 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.