libodbc++  0.2.5
callablestatement.h
1 /*
2  This file is part of libodbc++.
3 
4  Copyright (C) 1999-2000 Manush Dodunekov <manush@stendahls.net>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING. If not, write to
18  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  Boston, MA 02111-1307, USA.
20 */
21 
22 #ifndef __ODBCXX_CALLABLESTATEMENT_H
23 #define __ODBCXX_CALLABLESTATEMENT_H
24 
25 #include <odbc++/setup.h>
26 #include <odbc++/types.h>
27 #include <odbc++/preparedstatement.h>
28 
29 namespace odbc {
30 
57  class ODBCXX_EXPORT CallableStatement : public PreparedStatement {
58  friend class Connection;
59 
60  private:
61  bool lastWasNull_;
62 
63  protected:
65  SQLHSTMT hstmt,
66  const ODBCXX_STRING& sql,
67  int resultSetType,
68  int resultSetConcurrency);
69 
70  public:
72  virtual ~CallableStatement();
73 
77  double getDouble(int idx);
78 
82  bool getBoolean(int idx);
83 
87  signed char getByte(int idx);
88 
92  ODBCXX_BYTES getBytes(int idx);
93 
97  Date getDate(int idx);
98 
102  float getFloat(int idx);
103 
107  int getInt(int idx);
108 
112  Long getLong(int idx);
113 
117  short getShort(int idx);
118 
122  ODBCXX_STRING getString(int idx);
123 
127  Time getTime(int idx);
128 
132  Timestamp getTimestamp(int idx);
133 
139  void registerOutParameter(int idx, int sqlType) {
140  this->registerOutParameter(idx,sqlType,0);
141  }
142 
149  void registerOutParameter(int idx, int sqlType, int scale);
150 
154  void registerInParameter(int idx);
155 
157  bool wasNull() {
158  return lastWasNull_;
159  }
160  };
161 
162 
163 } // namespace odbc
164 
165 
166 #endif // __ODBCXX_CALLABLESTATEMENT_H
void registerOutParameter(int idx, int sqlType)
Registers an output parameter.
Definition: callablestatement.h:139
bool wasNull()
Returns true if the last fetched parameter was NULL.
Definition: callablestatement.h:157
An SQL DATE.
Definition: types.h:457
An SQL TIME.
Definition: types.h:575
A prepared statement.
Definition: preparedstatement.h:63
A prepared statement suited for stored procedure calls.
Definition: callablestatement.h:57
An SQL TIMESTAMP.
Definition: types.h:696
A database connection.
Definition: connection.h:38

Go back to the libodbc++ homepage