1 /***************************************************************************
2 * Copyright (C) 2007 by Prabakaran Thirumalai *
3 * praba_tuty@yahoo.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 ***************************************************************************/
16 #include<SessionImpl.h>
19 DbRetVal
Connection::open(const char *username
, const char *password
)
21 if (session
== NULL
) session
= new SessionImpl();
22 logger
.startLogger("/tmp/praba");
23 logFinest(logger
, "User logged in %s",username
);
24 return session
->open(username
, password
);
27 DbRetVal
Connection::close()
29 if (session
== NULL
) return ErrNoConnection
;
30 logFinest(logger
, "User logged out");
32 return session
->close();
35 DatabaseManager
* Connection::getDatabaseManager()
37 if (session
== NULL
) return NULL
;
38 return session
->getDatabaseManager();
41 UserManager
* Connection::getUserManager()
43 if (session
== NULL
) return NULL
;
44 return session
->getUserManager();
47 DbRetVal
Connection::startTransaction()
49 if (session
== NULL
) return ErrNoConnection
;
50 return session
->startTransaction();
54 DbRetVal
Connection::commit()
56 if (session
== NULL
) return ErrNoConnection
;
57 return session
->commit();
61 DbRetVal
Connection::rollback()
63 if (session
== NULL
) return ErrNoConnection
;
64 return session
->rollback();