Annotation of parser3/src/include/pa_sql_connection.h, revision 1.1

1.1     ! paf         1: /** @file
        !             2:        Parser: sql connection decl.
        !             3: 
        !             4:        Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
        !             5: 
        !             6:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
        !             7: 
        !             8:        $Id: pa_sql_driver_manager.h,v 1.1 2001/04/04 10:53:55 paf Exp $
        !             9: */
        !            10: 
        !            11: #ifndef PA_SQL_CONNECTION_H
        !            12: #define PA_SQL_CONNECTION_H
        !            13: 
        !            14: #include "pa_pool.h"
        !            15: #include "pa_sql_driver.h"
        !            16: #include "pa_exception.h"
        !            17: 
        !            18: /// sql connection
        !            19: class SQL_Connection : public Pooled {
        !            20: 
        !            21: public:
        !            22: 
        !            23:        void set_services(Services_for_SQL_driver *services) {
        !            24:                fdriver.set_services(services);
        !            25:        }
        !            26: 
        !            27:        SQL_Connection(Pool& pool,
        !            28:                const String& aurl, 
        !            29:                SQL_Driver& adriver, Services_for_SQL_driver& services, 
        !            30:                char *url_cstr) : Pooled(pool),
        !            31:                furl(aurl),
        !            32:                fdriver(adriver) {
        !            33: 
        !            34:                set_services(&services);
        !            35:                fdriver.connect(url_cstr, &info);
        !            36:        }
        !            37: 
        !            38:        void close() {
        !            39:                set_services(0); // deassociate from request
        !            40:                SQL_driver_manager->close_connection(furl, *this);
        !            41:        }
        !            42: 
        !            43:        void disconnect() { fdriver.disconnect(info); }
        !            44:        void commit() { fdriver.commit(info); }
        !            45:        void rollback() { fdriver.rollback(info); }
        !            46: 
        !            47: private:
        !            48: 
        !            49:        SQL_Driver& fdriver;
        !            50:        void *info;
        !            51:        const String& furl;
        !            52: };
        !            53: 
        !            54: #endif

E-mail: