10#if __DCL_HAVE_ALLOC_DEBUG
11#undef __DCL_ALLOC_LEVEL
12#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
19#if __DCL_HAVE_THIS_FILE__
29void SQLConnection::initialize(
SQLDriver* _driver)
86 mbs = UTF8Encoder::encode(_connstr);
92 if (!
__handle->open(mbs, mbs.length())) {
126 mbs = UTF8Encoder::encode(_sql);
132 if (!
__handle->execute(mbs, mbs.length())) {
190 ByteBuffer* buf = ByteBuffer::create(len);
191 if (!
__handle->getServerInfo(buf->data(), &len)) {
195 buf->__dataLength = len;
200 return UTF8Decoder::decode(
r);
216SQLConnectionPool::SQLConnectionPool(
217 const String& _connString,
218 const String& _driverName
226 __connString = _connString;
228 __allMax = (size_t)-1;
231SQLConnectionPool::~SQLConnectionPool()
239 SQLConnection*
r =
NULL;
251 catch(SQLException* e) {
263 catch (SQLException* e) {
268 catch (AssertError* e) {
289 while(nCloseCount--) {
295 catch(Exception* e) {
297 __T(
"SQLConnectionPool::clear(): %ls\n"),
305 catch (Exception* _e) {
315bool SQLConnectionPool::setMaxCount(
316 size_t _idleMax,
size_t _allMax
333void SQLConnectionPool::clear(
unsigned _waitSeconds)
341 && (_waitSeconds-- > 0)) {
351 __T(
"Warning! SQLConnection 강제 삭제!!! count(%d)\n"),
357 PointerArray::Iterator it =
__allConns.begin();
360 delete (SQLConnection*)((*it));
362 catch(Exception* e) {
364 __T(
"SQLConnectionPool::clear(): %ls\n"),
#define __DCL_TRACE1(fmt, arg1)
#define __DCL_ASSERT_PARAM(expr)
#define __DCL_ASSERT(expr)
#define IMPLEMENT_CLASSINFO(class_name, base_class_name)
virtual String toString() const
void open(const String &_connstr) __DCL_THROWS1(SQLException *)
String getServerInfo() __DCL_THROWS1(SQLException *)
SQLConnection(SQLDriver *_driver)
void rollbackTrans() __DCL_THROWS1(SQLException *)
bool inTransaction() const
SQL::Connection * __handle
void execute(const String &_sql) __DCL_THROWS1(SQLException *)
void commitTrans() __DCL_THROWS1(SQLException *)
void startTrans() __DCL_THROWS1(SQLException *)
void close() __DCL_THROWS1(SQLException *)
static SQLDriver * getDriver(const String &_name) __DCL_THROWS1(SQLDriverException *)
SQL::Connection * createConnection()
virtual String toString() const
static void sleep(unsigned int _mills)