--- parser3/src/include/pa_sql_connection.h 2001/04/05 08:09:21 1.1 +++ parser3/src/include/pa_sql_connection.h 2001/04/05 13:19:41 1.4 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_sql_connection.h,v 1.1 2001/04/05 08:09:21 paf Exp $ + $Id: pa_sql_connection.h,v 1.4 2001/04/05 13:19:41 paf Exp $ */ #ifndef PA_SQL_CONNECTION_H @@ -13,9 +13,9 @@ #include "pa_pool.h" #include "pa_sql_driver.h" -#include "pa_exception.h" +#include "pa_sql_driver_manager.h" -/// sql connection +/// SQL connection. handy wrapper around low level SQL_Driver class SQL_Connection : public Pooled { public: @@ -31,23 +31,38 @@ public: furl(aurl), fdriver(adriver) { - set_services(&services); - fdriver.connect(url_cstr, &info); + set_services(&services); // associate with services[request] + fdriver.connect(url_cstr, &connection); } void close() { - set_services(0); // deassociate from request + set_services(0); // deassociate from services[request] SQL_driver_manager->close_connection(furl, *this); } - void disconnect() { fdriver.disconnect(info); } - void commit() { fdriver.commit(info); } - void rollback() { fdriver.rollback(info); } + void disconnect() { fdriver.disconnect(connection); } + void commit() { fdriver.commit(connection); } + void rollback() { fdriver.rollback(connection); } + bool ping() { return fdriver.ping(connection); } + uint quote(char *to, const char *from, unsigned int length) { + return fdriver.quote(connection, to, from, length); + } + + void query( + const char *statement, unsigned long offset, unsigned long limit, + unsigned int *column_count, SQL_Driver::Cell **columns, + unsigned long *row_count, SQL_Driver::Cell ***rows) { + fdriver.query(connection, + statement, offset, limit, + column_count, columns, + row_count, rows); + } + private: SQL_Driver& fdriver; - void *info; + void *connection; const String& furl; };