Shadowrun: Awakened 29 September 2011 - Build 871
resultset.h
Go to the documentation of this file.
00001 /*
00002    Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc.  All rights reserved.
00003 
00004    The MySQL Connector/C++ is licensed under the terms of the GPL
00005    <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
00006    MySQL Connectors. There are special exceptions to the terms and
00007    conditions of the GPL as it is applied to this software, see the
00008    FLOSS License Exception
00009    <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
00010 */
00011 
00012 #ifndef _SQL_RESULTSET_H_
00013 #define _SQL_RESULTSET_H_
00014 
00015 #include "config.h"
00016 
00017 #include <list>
00018 #include <string>
00019 #include <map>
00020 #include <iostream>
00021 #include "resultset_metadata.h"
00022 
00023 
00024 namespace sql
00025 {
00026 
00027 class Statement;
00028 
00029 class RowID
00030 {
00031 public:
00032     virtual ~RowID() {}
00033 };
00034 
00035 class ResultSet
00036 {
00037 public:
00038     enum
00039     {
00040         CLOSE_CURSORS_AT_COMMIT,
00041         HOLD_CURSORS_OVER_COMMIT
00042     };
00043     enum
00044     {
00045         CONCUR_READ_ONLY,
00046         CONCUR_UPDATABLE
00047     };
00048     enum
00049     {
00050         FETCH_FORWARD,
00051         FETCH_REVERSE,
00052         FETCH_UNKNOWN
00053     };
00054     typedef enum
00055     {
00056         TYPE_FORWARD_ONLY,
00057         TYPE_SCROLL_INSENSITIVE,
00058         TYPE_SCROLL_SENSITIVE
00059     } enum_type;
00060 
00061     virtual ~ResultSet() {}
00062 
00063     virtual bool absolute(int row) = 0;
00064 
00065     virtual void afterLast() = 0;
00066 
00067     virtual void beforeFirst() = 0;
00068 
00069     virtual void close() = 0;
00070 
00071     virtual uint32_t findColumn(const std::string& columnLabel) const = 0;
00072 
00073     virtual bool first() = 0;
00074 
00075     virtual std::istream * getBlob(uint32_t columnIndex)  const = 0;
00076     virtual std::istream * getBlob(const std::string& columnLabel) const = 0;
00077 
00078     virtual bool getBoolean(uint32_t columnIndex) const = 0;
00079     virtual bool getBoolean(const std::string& columnLabel) const = 0;
00080 
00081     virtual long double getDouble(uint32_t columnIndex) const = 0;
00082     virtual long double getDouble(const std::string& columnLabel) const = 0;
00083 
00084     virtual int32_t getInt(uint32_t columnIndex) const = 0;
00085     virtual int32_t getInt(const std::string& columnLabel) const = 0;
00086 
00087     virtual uint32_t getUInt(uint32_t columnIndex) const = 0;
00088     virtual uint32_t getUInt(const std::string& columnLabel) const = 0;
00089 
00090     virtual int64_t getInt64(uint32_t columnIndex) const = 0;
00091     virtual int64_t getInt64(const std::string& columnLabel) const = 0;
00092 
00093     virtual uint64_t getUInt64(uint32_t columnIndex) const = 0;
00094     virtual uint64_t getUInt64(const std::string& columnLabel) const = 0;
00095 
00096     virtual ResultSetMetaData * getMetaData() const = 0;
00097 
00098     virtual size_t getRow() const = 0;
00099 
00100     virtual const Statement * getStatement() const = 0;
00101 
00102     virtual std::string getString(uint32_t columnIndex)  const = 0;
00103     virtual std::string getString(const std::string& columnLabel) const = 0;
00104 
00105     virtual enum_type getType() const = 0;
00106 
00107     virtual bool isAfterLast() const = 0;
00108 
00109     virtual bool isBeforeFirst() const = 0;
00110 
00111     virtual bool isClosed() const = 0;
00112 
00113     virtual bool isFirst() const = 0;
00114 
00115     virtual bool isLast() const = 0;
00116 
00117     virtual bool isNull(uint32_t columnIndex) const = 0;
00118     virtual bool isNull(const std::string& columnLabel) const = 0;
00119 
00120     virtual bool last() = 0;
00121 
00122     virtual bool next() = 0;
00123 
00124     virtual bool previous() = 0;
00125 
00126     virtual bool relative(int rows) = 0;
00127 
00128     virtual size_t rowsCount() const = 0;
00129 
00130     virtual bool wasNull() const = 0;
00131 };
00132 
00133 } /* namespace sql */
00134 
00135 #endif /* _SQL_RESULTSET_H_ */

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net