Nemiver  0.3
nmv-connection.h
Go to the documentation of this file.
1 /* -*- Mode: C++; indent-tabs-mode:nil; c-basic-offset: 4; -*- */
2 
3 /*
4  *This file is part of the Nemiver Project.
5  *
6  *Nemiver is free software; you can redistribute
7  *it and/or modify it under the terms of
8  *the GNU General Public License as published by the
9  *Free Software Foundation; either version 2,
10  *or (at your option) any later version.
11  *
12  *Nemiver is distributed in the hope that it will
13  *be useful, but WITHOUT ANY WARRANTY;
14  *without even the implied warranty of
15  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *See the GNU General Public License for more details.
17  *
18  *You should have received a copy of the
19  *GNU General Public License along with Nemiver;
20  *see the file COPYING.
21  *If not, write to the Free Software Foundation,
22  *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23  *
24  *See COPYRIGHT file copyright information.
25  */
26 #ifndef __NMV_CONNECTION_H__
27 #define __NMV_CONNECTION_H__
28 
29 #include "nmv-safe-ptr-utils.h"
30 #include "nmv-object.h"
32 
33 namespace nemiver {
34 
35 namespace common {
36 class UString;
37 class Buffer;
38 }
39 
40 namespace common {
41 class SQLStatement;
42 }
43 
44 namespace common {
45 
46 class ResultSetDataReader;
47 struct ConnectionPriv;
48 
50 {
51 
52  friend struct ConnectionPriv;
53  friend class ConnectionManager;
54  ConnectionPriv *m_priv;
55 
56  void set_connection_driver (const common::IConnectionDriverSafePtr &a_driver);
57  void initialize ();
58  void deinitialize ();
59 
60 public:
61  Connection ();
62 
63  Connection (const Connection &a_con);
64 
65  Connection& operator= (const Connection &a_con);
66 
67  bool is_initialized () const;
68 
69  virtual ~Connection ();
70 
71  const char* get_last_error () const;
72 
73  bool start_transaction ();
74 
75  bool commit_transaction ();
76 
77  bool rollback_transaction ();
78 
79  bool execute_statement (const common::SQLStatement &a_statement);
80 
81  bool should_have_data () const;
82 
83  bool read_next_row ();
84 
85  unsigned long get_number_of_columns ();
86 
87  bool get_column_type (unsigned long a_offset,
88  enum common::ColumnType &);
89 
90  bool get_column_name (unsigned long a_offset, common::Buffer &a_name);
91 
92  bool get_column_content (unsigned long a_offset,
93  common::Buffer &a_field_content);
94 
95  bool get_column_content (gulong a_offset,
96  gint64 &a_column_content);
97 
98  bool get_column_content (gulong a_offset,
99  double& a_column_content);
100 
101  bool get_column_content (gulong a_offset,
102  common::UString& a_column_content);
103 
104  void close ();
105 };//end Connection
106 
110 
111 }//end namespace common
112 }//end nemiver
113 #endif //end __NMV_CONNECTION_H__
114 
nmv-safe-ptr-utils.h
nemiver::common::Object
Definition: nmv-object.h:43
nemiver
Definition: nmv-address.h:31
nemiver::common::ObjectRef
Definition: nmv-safe-ptr-utils.h:45
NEMIVER_API
#define NEMIVER_API
Definition: nmv-api-macros.h:53
nemiver::common::ColumnType
ColumnType
Definition: nmv-i-connection-driver.h:42
nemiver::common::Connection
Definition: nmv-connection.h:49
nmv-i-connection-driver.h
nemiver::common::UString
Definition: nmv-ustring.h:45
nemiver::common::ConnectionManager
declaration of the entry point of the db abstraction layer. this class has the capacity to set the ty...
Definition: nmv-connection-manager.h:46
nemiver::common::ConnectionSafePtr
common::SafePtr< Connection, common::ObjectRef, common::ObjectUnref > ConnectionSafePtr
Definition: nmv-connection.h:109
nemiver::common::SQLStatement
Definition: nmv-sql-statement.h:98
nemiver::common::ObjectUnref
Definition: nmv-safe-ptr-utils.h:55
nemiver::common::Buffer
Definition: nmv-buffer.h:34
nmv-object.h
nemiver::common::SafePtr
Definition: nmv-safe-ptr.h:71
common
Definition: nmv-proc-list-dialog.h:32