Diff for /parser3/src/include/pa_sql_connection.h between versions 1.13 and 1.16

version 1.13, 2001/09/26 10:32:25 version 1.16, 2001/10/29 17:34:24
Line 15 Line 15
 #include "pa_sql_driver.h"  #include "pa_sql_driver.h"
 #include "pa_sql_driver_manager.h"  #include "pa_sql_driver_manager.h"
   
 /// SQL fconnection. handy wrapper around low level SQL_Driver  // defines
   
   /// @see SQL_Driver_services_impl::_throw
   #define SQL_CONNECTION_FUNC_GUARDED(actions) \
           if(!fservices || !setjmp(fservices->mark)) { \
                   actions; \
           } else \
                   fservices->propagate_exception();
   
   /// SQL connection. handy wrapper around low level SQL_Driver
 class SQL_Connection : public Pooled {  class SQL_Connection : public Pooled {
   
 public:  public:
Line 43  public: Line 52  public:
   
         bool connected() { return fconnection!=0; }          bool connected() { return fconnection!=0; }
         void connect(char *used_only_in_connect_url_cstr) {           void connect(char *used_only_in_connect_url_cstr) { 
                 fdriver.connect(used_only_in_connect_url_cstr, *fservices, &fconnection);                  SQL_CONNECTION_FUNC_GUARDED(
                           fdriver.connect(used_only_in_connect_url_cstr, *fservices, &fconnection)
                   );
           }
           void disconnect() { 
                   fdriver.disconnect(fconnection); fconnection=0; 
           }
           void commit() { 
                   SQL_CONNECTION_FUNC_GUARDED(
                           fdriver.commit(*fservices, fconnection) 
                   );
           }
           void rollback() { 
                   SQL_CONNECTION_FUNC_GUARDED(
                           fdriver.rollback(*fservices, fconnection)
                   );
           }
           bool ping() { 
                   SQL_CONNECTION_FUNC_GUARDED(
                           return fdriver.ping(*fservices, fconnection)
                   );
                   return 0; // never reached
         }          }
         void disconnect() { fdriver.disconnect(fconnection); fconnection=0; }  
         void commit() { fdriver.commit(*fservices, fconnection); }  
         void rollback() { fdriver.rollback(*fservices, fconnection); }  
         bool ping() { return fdriver.ping(*fservices, fconnection); }  
         uint quote(char *to, const char *from, unsigned int length) {          uint quote(char *to, const char *from, unsigned int length) {
                 return fdriver.quote(*fservices, fconnection, to, from, length);                  SQL_CONNECTION_FUNC_GUARDED(
                           return fdriver.quote(*fservices, fconnection, to, from, length)
                   );
                   return 0; // never reached
         }          }
   
         void query(          void query(
                 const char *statement, unsigned long offset, unsigned long limit,                  const char *statement, unsigned long offset, unsigned long limit,
                 SQL_Driver_query_event_handlers& handlers) {                   SQL_Driver_query_event_handlers& handlers) { 
                 fdriver.query(*fservices, fconnection,                   SQL_CONNECTION_FUNC_GUARDED(
                         statement, offset, limit,                           fdriver.query(*fservices, fconnection, 
                         handlers);                                  statement, offset, limit, 
                                   handlers)
                   );
         }          }
   
   

Removed from v.1.13  
changed lines
  Added in v.1.16


E-mail: