Shadowrun: Awakened 29 September 2011 - Build 871
prepared_statement.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 
00013 #ifndef _SQL_PREPARED_STATEMENT_H_
00014 #define _SQL_PREPARED_STATEMENT_H_
00015 
00016 #include <iostream>
00017 #include "statement.h"
00018 
00019 
00020 namespace sql
00021 {
00022 
00023 class Connection;
00024 class ResultSet;
00025 class ResultSetMetaData;
00026 class ParameterMetaData;
00027 
00028 class PreparedStatement : public Statement
00029 {
00030 public:
00031     virtual ~PreparedStatement() {}
00032 
00033     virtual void clearParameters() = 0;
00034 
00035     virtual bool execute(const std::string& sql) = 0;
00036     virtual bool execute() = 0;
00037 
00038     virtual ResultSet *executeQuery(const std::string& sql) = 0;
00039     virtual ResultSet *executeQuery() = 0;
00040 
00041     virtual int executeUpdate(const std::string& sql) = 0;
00042     virtual int executeUpdate() = 0;
00043 
00044     virtual ResultSetMetaData * getMetaData() = 0;
00045 
00046     virtual ParameterMetaData * getParameterMetaData() = 0;
00047 
00048     virtual void setBigInt(unsigned int parameterIndex, const std::string& value) = 0;
00049 
00050     virtual void setBlob(unsigned int parameterIndex, std::istream * blob) = 0;
00051 
00052     virtual void setBoolean(unsigned int parameterIndex, bool value) = 0;
00053 
00054     virtual void setDateTime(unsigned int parameterIndex, const std::string& value) = 0;
00055 
00056     virtual void setDouble(unsigned int parameterIndex, double value) = 0;
00057 
00058     virtual void setInt(unsigned int parameterIndex, int32_t value) = 0;
00059 
00060     virtual void setUInt(unsigned int parameterIndex, uint32_t value) = 0;
00061 
00062     virtual void setInt64(unsigned int parameterIndex, int64_t value) = 0;
00063 
00064     virtual void setUInt64(unsigned int parameterIndex, uint64_t value) = 0;
00065 
00066     virtual void setNull(unsigned int parameterIndex, int sqlType) = 0;
00067 
00068     virtual void setString(unsigned int parameterIndex, const std::string& value) = 0;
00069 
00070     virtual PreparedStatement * setResultSetType(sql::ResultSet::enum_type type) = 0;
00071 };
00072 
00073 
00074 } /* namespace sql */
00075 
00076 #endif /* _SQL_PREPARED_STATEMENT_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