Remove nwmode in csqlnw.conf file and making UDPClient and UDPServer as
[csql.git] / include / SqlConnection.h
blobb9e77562a1662788bb2cd6c70212b85add556ce5
1 /***************************************************************************
2 * Copyright (C) 2007 by Prabakaran Thirumalai *
3 * praba_tuty@yahoo.com *
4 * *
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. *
9 * *
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. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifndef SQLCONNECTION_H
21 #define SQLCONNECTION_H
22 #include<CSql.h>
23 #include<AbsSqlConnection.h>
24 #include<SqlFactory.h>
26 class SqlConnection : public AbsSqlConnection
28 Connection conn;
29 public:
30 SqlConnection(){innerConn = NULL; }
32 /** opens connection to the sql engine
33 * @param user username for authentication
34 * @param pass password for authentication
35 * @return DbRetVal
37 DbRetVal connect (char *user, char * pass)
38 { return conn.open(user, pass); }
40 /** closes connection to the database and releases all the resources
41 * @return DbRetVal
43 DbRetVal disconnect () { return conn.close(); }
45 /** Commits active transaction.
46 * It makes all the changes made in the current transaction permanent and <br/>
47 * it also releases the locks held by the current transaction.<br/>
48 * After a transaction commits, application is required to start another <br/>
49 * transaction for further database operations.
50 * @return DbRetVal
52 DbRetVal commit() { return conn.commit(); }
54 /** Aborts the active transaction.
55 * undo all the changes made in the current transaction and it also <br/>
56 * releases the locks held by the current transaction.<br/>
57 * After a transaction rollback, application is required to start another <br/>
58 * transaction for further database operations.
59 * @return DbRetVal
61 DbRetVal rollback() { return conn.rollback(); }
63 /** Starts a transaction.
64 * The previous transaction should be either committed or rollback <br/>
65 * before beginTrans is called. <br/>
66 * Applications are required to start transaction before they attempt any <br>
67 * database operation.
68 * @param isoLevel isolation level. Default is read committed.
69 * @return DbRetVal
71 DbRetVal beginTrans (IsolationLevel isoLevel = READ_COMMITTED)
72 { return conn.startTransaction(isoLevel); }
74 Connection& getConnObject(){ return conn; }
75 friend class SqlFactory;
78 #endif