13#if __DCL_HAVE_ALLOC_DEBUG
14#undef __DCL_ALLOC_LEVEL
15#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
42 : __name(_name), __errorCode(_errorCode)
47 const String& _driverSummary)
48 : __name(_name), __errorCode(_errorCode), __driverSummary(_driverSummary)
54 StringBuilder
r = __name;
62 switch (__errorCode) {
63 case eInvalidDriverModule:
64 r +=
__T(
"Invalid Driver Module");
67 r +=
__T(
"Invalid DCL_SQL_VERSION");
70 r +=
__T(
"Initialize callback fail!");
73 r +=
__T(
"cleanup callback falil");
79 if (!__driverSummary.isEmpty())
80 r +=
__T(
" :") + __driverSummary;
128 StringBuilder filename = _name
144 int flags = Dll::DEFAULT
151 Dll::open(filename.toString(), flags);
169 SQLDriverException::eInvalidDriverModule);
175 SQLDriverException::eInvalidDriverModule);
180 SQLDriverException::eInvalidVersion);
187 SQLDriverException::eInvalidDriverModule);
192 SQLDriverException::eInitializeFail
229 SQLDriverException::eCleanupFail,
258 return pNewConnection;
274 r +=
__T(
", DCLVersion:");
280 r +=
__T(
", InterfaceVersion:");
294 r += L
", pfnInitialize: (null)";
296 r += L
", pfnCleanup: (null)";
298 r += L
", pfnCreateConnectionInstance: (null)";
301 r += L
", FileVersion:";
306 r += L
", ServerTitle:";
321 PointerArray __drivers;
330 bool isEmpty()
const {
return __drivers.isEmpty(); }
338 String name = _name.trim();
342 for (PointerArray::Iterator it = __drivers.begin();
343 it != __drivers.end(); it++) {
344 if (!((
SQLDriver*)(*it))->driverName().compareNoCase(name)) {
353 __T(
"Open New SQLDriver: %ls, Prev-Count: %d\n"),
359 __drivers.add(pSQLDriver);
369 for(PointerArray::Iterator it = __drivers.begin();
370 it != __drivers.end(); it++) {
379 pSQLDriver->fileName().data()
399 PointerArray::Iterator it = __drivers.find(pSQLDriver);
408 pSQLDriver->driverName().data(),
409 pSQLDriver->fileName().data()
427static void cleanupDriverContext()
429 if (__pDriverPool ==
NULL)
434 __pDriverPool->clearAll();
435 delete __pDriverPool;
436 __pDriverPool =
NULL;
449 if (__pDriverPool ==
NULL) {
455 r = __pDriverPool->getDriver(_name);
480 __pDriverPool->clear(_pSQLDriver);
#define DCL_DSO_ENTRY_POINT_STRING
#define DCL_MINOR_VERSION(uVersion)
#define DCL_MAJOR_VERSION(uVersion)
__DCL_BEGIN_NAMESPACE LibState * __pLibState
#define __DCL_TRACE1(fmt, arg1)
#define __DCL_TRACE3(fmt, arg1, arg2, arg3)
#define DECLARE_CLASSINFO(class_name)
#define __DCL_ASSERT(expr)
#define IMPLEMENT_CLASSINFO(class_name, base_class_name)
#define __DCL_TRACE2(fmt, arg1, arg2)
void CharsetConvertException *size_t n
void CharsetConvertException *__fields clear()
virtual String toString() const
const Exception * cause() const
virtual String toString() const
SQLDriverException(const String &_name, Exception *_cause)
static SQLDriver * getDriver(const String &_name) __DCL_THROWS1(SQLDriverException *)
SQL::Connection * createConnection()
static void closeDriver(SQLDriver *_pSQLDriver) __DCL_THROWS1(SQLDriverException *)
void close() __DCL_THROWS1(SQLDriverException *)
String getDriverSummary() const
SQLDriver(const String &_name) __DCL_THROWS1(SQLDriverException *)
SQL::DRIVER_MODULE * __pModuleEntryPoint
const String & driverName() const
void destroyConnection(SQL::Connection *pConnection)
void open(const String &_name) __DCL_THROWS1(SQLDriverException *)
SQLDriver * getDriver(const String &_name) __DCL_THROWS1(SQLDriverException *)
void clear(SQLDriver *pDriver) __DCL_THROWS1(SQLDriverException *)
static long incrementAndGet(volatile long &_n)
static long decrementAndGet(volatile long &_n)
Connection *(* pfnCreateConnectionInstance)()