Diff for /parser3/src/include/pa_sql_connection.h between versions 1.1 and 1.7

version 1.1, 2001/04/05 08:09:21 version 1.7, 2001/05/17 10:22:24
Line 11 Line 11
 #ifndef PA_SQL_CONNECTION_H  #ifndef PA_SQL_CONNECTION_H
 #define PA_SQL_CONNECTION_H  #define PA_SQL_CONNECTION_H
   
   #include "pa_config_includes.h"
 #include "pa_pool.h"  #include "pa_pool.h"
 #include "pa_sql_driver.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 {  class SQL_Connection : public Pooled {
   
 public:  public:
   
         void set_services(Services_for_SQL_driver *services) {          void set_services(SQL_Driver_services *services) {
                 fdriver.set_services(services);                  fdriver.set_services(services);
         }          }
   
         SQL_Connection(Pool& pool,          SQL_Connection(Pool& pool,
                 const String& aurl,                   const String& aurl, 
                 SQL_Driver& adriver, Services_for_SQL_driver& services,                   SQL_Driver& adriver, SQL_Driver_services& services, 
                 char *url_cstr) : Pooled(pool),                  char *used_only_in_constructor_url_cstr) : Pooled(pool),
                 furl(aurl),                  furl(aurl),
                 fdriver(adriver) {                  fdriver(adriver) {
   
                 set_services(&services);                  set_services(&services); // associate with services[request]
                 fdriver.connect(url_cstr, &info);                  fdriver.connect(used_only_in_constructor_url_cstr, &connection);
         }          }
   
         void close() {          void close() {
                 set_services(0); // deassociate from request                  set_services(0); // deassociate from services[request]
                 SQL_driver_manager->close_connection(furl, *this);                  SQL_driver_manager->close_connection(furl, *this);
         }          }
   
         void disconnect() { fdriver.disconnect(info); }          void disconnect() { fdriver.disconnect(connection); }
         void commit() { fdriver.commit(info); }          void commit() { fdriver.commit(connection); }
         void rollback() { fdriver.rollback(info); }          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:  private:
   
         SQL_Driver& fdriver;          SQL_Driver& fdriver;
         void *info;          void *connection;
         const String& furl;          const String& furl;
 };  };
   

Removed from v.1.1  
changed lines
  Added in v.1.7


E-mail: