| 1 | 
#ifndef YSQL_CONNECTION_H | 
| 2 | 
#define YSQL_CONNECTION_H | 
| 3 | 
 | 
| 4 | 
#include <TSQLServer.h> | 
| 5 | 
#include <YException.h> | 
| 6 | 
 | 
| 7 | 
using namespace yngn::YException; | 
| 8 | 
 | 
| 9 | 
namespace yngn { | 
| 10 | 
    namespace sql { | 
| 11 | 
        /** | 
| 12 | 
         * Connection to the database. | 
| 13 | 
         * In the furure it should became a pool of connections | 
| 14 | 
         */ | 
| 15 | 
        class YSQLConnection { | 
| 16 | 
        private: | 
| 17 | 
          /** | 
| 18 | 
           * The physics event that is created in this algorithm. | 
| 19 | 
           */ | 
| 20 | 
          static TSQLServer        *sqlServer; | 
| 21 | 
          static YSQLConnection    *sqlConnection; | 
| 22 | 
 | 
| 23 | 
          YSQLConnection(char*, char*, char*) throw (YSQLNotConnectedException); | 
| 24 | 
        public:  | 
| 25 | 
          static bool isConnected() { return (sqlServer == NULL); } | 
| 26 | 
          static TSQLServer* getConnection(char*, char*, char*) throw (YSQLNotConnectedException); | 
| 27 | 
          //static TSQLServer* getConnection(char*) throw (YSQLNotConnectedException); | 
| 28 | 
          static TSQLServer* getConnection(void) throw (YSQLNotConnectedException); | 
| 29 | 
        }; | 
| 30 | 
    } | 
| 31 | 
} | 
| 32 | 
#endif /* YSQL_CONNECTION_H */ |