- Main Page
- Related Pages
- Modules
- Classes
- Files

# ISQLDataReader.h

Go to the documentation of this file.

    00001 #ifndef _ISQLDATAREADER_H_
    00002 #define _ISQLDATAREADER_H_
    00003
    00004 //
    00005 // Copyright (C) 2004-2006  Autodesk, Inc.
    00006 //
    00007 // This library is free software; you can redistribute it and/or
    00008 // modify it under the terms of version 2.1 of the GNU Lesser
    00009 // General Public License as published by the Free Software Foundation.
    00010 //
    00011 // This library is distributed in the hope that it will be useful,
    00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014 // Lesser General Public License for more details.
    00015 //
    00016 // You should have received a copy of the GNU Lesser General Public
    00017 // License along with this library; if not, write to the Free Software
    00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    00019 //
    00020 #ifdef _WIN32
    00021 #pragma once
    00022 #endif
    00023
    00024 #include <FdoStd.h>
    00025
    00026 /// \brief
    00027 /// The FdoISQLDataReader interface provides a forward-only, read-only
    00028 /// iterator for reading relational table data. A reference to an
    00029 /// FdoISQLDataReader is returned from the SQLCommands ExecuteReader method.
    00030 /// The initial position of the FdoISQLDataReader interface is prior to the first item.
    00031 /// Thus, you must call ReadNext to begin accessing any data.
    00032 class FdoISQLDataReader: public FdoIDisposable
    00033 {
    00034 public:
    00035     /// \brief
    00036     /// Gets the number of columns in the result set.
    00037     ///
    00038     /// \return
    00039     /// Returns the number of columns.
    00040     ///
    00041     FDO_API virtual FdoInt32 GetColumnCount() = 0;
    00042
    00043     /// \brief
    00044     /// Gets the name of the column at the given ordinal position.
    00045     ///
    00046     /// \param index
    00047     /// Input the position of the column.
    00048     ///
    00049     /// \return
    00050     /// Returns the column name
    00051     ///
    00052     FDO_API virtual FdoString* GetColumnName(FdoInt32 index) = 0;
    00053
    00054     /// \brief
    00055     /// Gets the data type of the column with the specified name.
    00056     ///
    00057     /// \param columnName
    00058     /// Input the column name.
    00059     ///
    00060     /// \return
    00061     /// Returns the type of the column.
    00062     ///
    00063     FDO_API virtual FdoDataType GetColumnType(FdoString* columnName) = 0;
    00064
    00065     /// \brief
    00066     /// Gets the FDO property type of the column with the specified name. This is used
    00067     ///  to indicate if a given column is a geometric property or a data property. If the column is
    00068     ///  a FdoPropertyType_DataProperty, then GetColumnType can be used to find the data type of the column.
    00069     ///
    00070     /// \param columnName
    00071     /// Input the column name.
    00072     ///
    00073     /// \return
    00074     /// Returns the FDO property type of the column.
    00075     ///
    00076     FDO_API virtual FdoPropertyType GetPropertyType(FdoString* columnName) = 0;
    00077
    00078     /// \brief
    00079     /// Gets the Boolean value of the specified column. No conversion is
    00080     /// performed, thus the column must be FdoDataType_Boolean or an
    00081     /// exception is thrown.
    00082     ///
    00083     /// \param columnName
    00084     /// Input the column name.
    00085     ///
    00086     /// \return
    00087     /// Returns the Boolean value
    00088     ///
    00089     FDO_API virtual bool GetBoolean(FdoString* columnName) = 0;
    00090
    00091     /// \brief
    00092     /// Gets the byte value of the specified column. No conversion is
    00093     /// performed, thus the column must be FdoDataType_Byte or an
    00094     /// exception is thrown.
    00095     ///
    00096     /// \param columnName
    00097     /// Input the column name.
    00098     ///
    00099     /// \return
    00100     /// Returns the byte value.
    00101     ///
    00102     FDO_API virtual FdoByte GetByte(FdoString* columnName) = 0;
    00103
    00104     /// \brief
    00105     /// Gets the date time value of the specified column. No conversion
    00106     /// is performed, thus the column must be FdoDataType_DateTime or
    00107     /// an exception is thrown.
    00108     ///
    00109     /// \param columnName
    00110     /// Input the column name.
    00111     ///
    00112     /// \return
    00113     /// Returns the date and time value.
    00114     ///
    00115     FDO_API virtual FdoDateTime GetDateTime(FdoString* columnName) = 0;
    00116
    00117     /// \brief
    00118     /// Gets the double-precision floating point value of the specified column.
    00119     /// No conversion is performed, thus the column must be of type
    00120     /// Double or an exception is thrown.
    00121     ///
    00122     /// \param columnName
    00123     /// Input the column name.
    00124     ///
    00125     /// \return
    00126     /// Returns the double value.
    00127     ///
    00128     FDO_API virtual double GetDouble(FdoString* columnName) = 0;
    00129
    00130     /// \brief
    00131     /// Gets the signed 16-bit integer value of the specified column. No conversion is
    00132     /// performed, thus the column must be FdoDataType_Int16 or an
    00133     /// exception is thrown.
    00134     ///
    00135     /// \param columnName
    00136     /// Input the column name.
    00137     ///
    00138     /// \return
    00139     /// Returns the FdoInt16 value.
    00140     ///
    00141     FDO_API virtual FdoInt16 GetInt16(FdoString* columnName) = 0;
    00142
    00143     /// \brief
    00144     /// Gets the signed 32-bit integer value of the specified column. No conversion is
    00145     /// performed, thus the column must be FdoDataType_Int32 or an
    00146     /// exception is thrown.
    00147     ///
    00148     /// \param columnName
    00149     /// Input the column name.
    00150     ///
    00151     /// \return
    00152     /// Returns the FdoInt32 value.
    00153     ///
    00154     FDO_API virtual FdoInt32 GetInt32(FdoString* columnName) = 0;
    00155
    00156     /// \brief
    00157     /// Gets the signed 64-bit integer value of the specified column. No conversion
    00158     /// is performed, thus the column must be FdoDataType_Int64 or an
    00159     /// exception is thrown.
    00160     ///
    00161     /// \param columnName
    00162     /// Input the column name.
    00163     ///
    00164     /// \return
    00165     /// Returns the FdoInt64 value.
    00166     ///
    00167     FDO_API virtual FdoInt64 GetInt64(FdoString* columnName) = 0;
    00168
    00169     /// \brief
    00170     /// Gets the single-precision floating point value of the specified column.
    00171     /// No conversion is performed, thus the column must be FdoDataType_Single
    00172     /// or an exception is thrown.
    00173     ///
    00174     /// \param columnName
    00175     /// Input the column name.
    00176     ///
    00177     /// \return
    00178     /// Returns the single value
    00179     ///
    00180     FDO_API virtual float GetSingle(FdoString* columnName) = 0;
    00181
    00182     /// \brief
    00183     /// Gets the string value of the specified column. No conversion is
    00184     /// performed, thus the column must be FdoDataType_String or an
    00185     /// exception is thrown.
    00186     ///
    00187     /// \param columnName
    00188     /// Input the column name.
    00189     ///
    00190     /// \return
    00191     /// Returns the string value.
    00192     ///
    00193     FDO_API virtual FdoString* GetString(FdoString* columnName) = 0;
    00194
    00195     /// \brief
    00196     /// Gets a LOBValue reference. The LOB is fully read in and data available.
    00197     /// Because no conversion is performed, the property must be FdoDataType_BLOB or
    00198     /// FdoDataType_CLOB etc. (a LOB type)
    00199     ///
    00200     /// \param propertyName
    00201     /// Input the property name.
    00202     ///
    00203     /// \return
    00204     /// Returns the reference to LOBValue
    00205     ///
    00206     FDO_API virtual FdoLOBValue* GetLOB(FdoString* propertyName) = 0;
    00207
    00208     /// \brief
    00209     /// Gets a reference of the specified LOB property as a FdoBLOBStreamReader or
    00210     /// FdoCLOBStreamReader etc. to allow reading in blocks of data.
    00211     /// Because no conversion is performed, the property must be FdoDataType_BLOB
    00212     /// or FdoDataType_CLOB etc. (a LOB type)
    00213     /// Cast the FdoIStreamReader to the appropiate LOB Stream Reader.
    00214     ///
    00215     /// \param propertyName
    00216     /// Input the property name.
    00217     ///
    00218     /// \return
    00219     /// Returns a reference to a LOB stream reader
    00220     ///
    00221     FDO_API virtual FdoIStreamReader* GetLOBStreamReader(const wchar_t* propertyName ) = 0;
    00222
    00223     /// \brief
    00224     /// Returns true if the value of the specified column is null.
    00225     ///
    00226     /// \param columnName
    00227     /// Input the column name.
    00228     ///
    00229     /// \return
    00230     /// Returns true if the value is null.
    00231     ///
    00232     FDO_API virtual bool IsNull(FdoString* columnName) = 0;
    00233
    00234     /// \brief
    00235     /// Gets the geometry value of the specified column as a byte array
    00236     /// in FGF format. No conversion is performed, thus the column
    00237     /// must be of Geometric type or an exception is thrown.
    00238     ///
    00239     /// \param columnName
    00240     /// Input the column name.
    00241     ///
    00242     /// \return
    00243     /// Returns the FGF byte array value.
    00244     ///
    00245     FDO_API virtual FdoByteArray* GetGeometry(FdoString* columnName) = 0;
    00246
    00247     /// \brief
    00248     /// Advances the reader to the next item. The default position of the
    00249     /// reader is prior to the first item. Thus, you must call ReadNext
    00250     /// to begin accessing any data.
    00251     ///
    00252     /// \return
    00253     /// Returns true if there is a next item.
    00254     ///
    00255     FDO_API virtual bool ReadNext() = 0;
    00256
    00257     /// \brief
    00258     /// Closes the FdoISQLDataReader object, freeing any resources it may be holding.
    00259     ///
    00260     /// \return
    00261     /// Returns nothing
    00262     ///
    00263     FDO_API virtual void Close() = 0;
    00264 };
    00265 #endif
    00266
    00267

Please send us your comment about this page