2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 * @file FIoDbStatement.h
18 * @brief This is the header file for the %DbStatement class.
20 * This header file contains the declarations of the %DbStatement class.
23 #ifndef _FIO_DB_STATEMENT_H_
24 #define _FIO_DB_STATEMENT_H_
26 #include <FBaseString.h>
27 #include <FBaseByteBuffer.h>
28 #include <FBaseDateTime.h>
29 #include <FBaseRtMutex.h>
30 #include <FIoDbTypes.h>
32 namespace Tizen { namespace Io
37 * @brief This class provides methods for evaluating pre-compiled statements.
41 * @final This class is not intended for extension.
43 * The %DbStatement class provides methods for evaluating pre-compiled statements.
45 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/io/database_operations.htm">Database Operations</a>.
47 class _OSP_EXPORT_ DbStatement
48 : public Tizen::Base::Object
53 * This destructor overrides Tizen::Base::Object::~Object().
57 virtual ~DbStatement(void);
60 * Binds the specified integer value to the statement parameter.
63 * @brief <i> [Compatibility] </i>
67 * @compatibility This method has compatibility issues with OSP compatible applications. @n
68 * For more information, see @ref CompDatabaseExceptionPage "here".
71 * @return An error code
72 * @param[in] columnIndex The column index to bind the value
73 * @param[out] value The integer value to bind
74 * @exception E_SUCCESS The method is successful.
75 * @exception E_INVALID_STATE Either of the following conditions has occurred:
76 * - The instance has not been properly constructed.
77 * - The instance is finalized.
78 * @exception E_INVALID_ARG The specified @c columnIndex is invalid.
79 * @exception E_INVALID_OPERATION This method has failed to bind the parameter because the database state has not been reset
80 * after executing the SELECT query by using Database::ExecuteStatementN() or DbEnumerator::MoveNext(). @n
81 * In this case DbEnumerator::Reset() should be invoked before calling this method.
83 result BindInt(int columnIndex, int value);
86 * Binds the specified @c long @c long value to the statement parameter.
89 * @brief <i> [Compatibility] </i>
93 * @compatibility This method has compatibility issues with OSP compatible applications. @n
94 * For more information, see @ref CompDatabaseExceptionPage "here".
97 * @return An error code
98 * @param[in] columnIndex The column index to bind the value
99 * @param[out] value The 64-bit integer value to bind
100 * @exception E_SUCCESS The method is successful.
101 * @exception E_INVALID_STATE Either of the following conditions has occurred:
102 * - The instance has not been properly constructed.
103 * - The instance is finalized.
104 * @exception E_INVALID_ARG The specified @c columnIndex is invalid.
105 * @exception E_INVALID_OPERATION This method has failed to bind the parameter because the database state has not been reset
106 * after executing the SELECT query by using Database::ExecuteStatementN() or DbEnumerator::MoveNext(). @n
107 * In this case DbEnumerator::Reset() should be invoked before calling this method.
109 result BindInt64(int columnIndex, long long value);
112 * Binds the specified @c double value to the statement parameter.
115 * @brief <i> [Compatibility] </i>
119 * @compatibility This method has compatibility issues with OSP compatible applications. @n
120 * For more information, see @ref CompDatabaseExceptionPage "here".
123 * @return An error code
124 * @param[in] columnIndex The column index to bind the value
125 * @param[out] value The @c double value to bind
126 * @exception E_SUCCESS The method is successful.
127 * @exception E_INVALID_STATE Either of the following conditions has occurred:
128 * - The instance has not been properly constructed.
129 * - The instance is finalized.
130 * @exception E_INVALID_ARG The specified @c columnIndex is invalid.
131 * @exception E_INVALID_OPERATION This method has failed to bind the parameter because the database state has not been reset
132 * after executing the SELECT query by using Database::ExecuteStatementN() or DbEnumerator::MoveNext(). @n
133 * In this case DbEnumerator::Reset() should be invoked before calling this method.
135 result BindDouble(int columnIndex, double value);
138 * Binds the specified string value to the statement parameter.
141 * @brief <i> [Compatibility] </i>
145 * @compatibility This method has compatibility issues with OSP compatible applications. @n
146 * For more information, see @ref CompDatabaseExceptionPage "here".
149 * @return An error code
150 * @param[in] columnIndex The column index to bind the value
151 * @param[out] value The string value to bind
152 * @exception E_SUCCESS The method is successful.
153 * @exception E_INVALID_STATE Either of the following conditions has occurred:
154 * - The instance has not been properly constructed.
155 * - The instance is finalized.
156 * @exception E_INVALID_ARG The specified @c value exceeds size limit.
157 * @exception E_INVALID_OPERATION This method has failed to bind the parameter because the database state has not been reset
158 * after executing the SELECT query by using Database::ExecuteStatementN() or DbEnumerator::MoveNext(). @n
159 * In this case DbEnumerator::Reset() should be invoked before calling this method.
161 result BindString(int columnIndex, const Tizen::Base::String& value);
164 * Binds the specified ByteBuffer type value to the statement parameter.
167 * @brief <i> [Compatibility] </i>
171 * @compatibility This method has compatibility issues with OSP compatible applications. @n
172 * For more information, see @ref CompDatabaseExceptionPage "here".
175 * @return An error code
176 * @param[in] columnIndex The column index to bind the value
177 * @param[out] value The blob value to bind @n
178 * The maximum available size is limited to 100 MBytes.
179 * @exception E_SUCCESS The method is successful.
180 * @exception E_INVALID_STATE Either of the following conditions has occurred:
181 * - The instance has not been properly constructed.
182 * - The instance is finalized.
183 * @exception E_INVALID_ARG Either of the following conditions has occurred:
184 * - The specified @c columnIndex is invalid.
185 * - The size of the byte buffer is less than @c 0 or has @c null data.
186 * - The specified @c value exceeds size limit.
187 * @exception E_INVALID_OPERATION This method has failed to bind the parameter because the database state has not been reset
188 * after executing the SELECT query by using Database::ExecuteStatementN() or DbEnumerator::MoveNext(). @n
189 * In this case DbEnumerator::Reset() should be invoked before calling this method.
190 * @remarks The bound @c byte array size is from the current position of byte buffer to the limit.
192 result BindBlob(int columnIndex, const Tizen::Base::ByteBuffer& value);
195 * Binds the specified raw blob data to the statement parameter.
198 * @brief <i> [Compatibility] </i>
202 * @compatibility This method has compatibility issues with OSP compatible applications. @n
203 * For more information, see @ref CompDatabaseExceptionPage "here".
206 * @return An error code
207 * @param[in] columnIndex The index of the column to bind the value
208 * @param[in] buffer A pointer to the buffer where blob data is located @n
209 * The maximum available size is limited to 100 MBytes.
210 * @param[in] size The blob data length in bytes
211 * @exception E_SUCCESS The method is successful.
212 * @exception E_INVALID_STATE Either of the following conditions has occurred:
213 * - The instance has not been properly constructed.
214 * - The instance is finalized.
215 * @exception E_INVALID_ARG Either of the following conditions has occurred:
216 * - The specified @c columnIndex is invalid.
217 * - The specified @c size is less than @c 0.
218 * - The pointer to the buffer is @c null.
219 * - The specified @c buffer exceeds size limit.
220 * @exception E_INVALID_OPERATION This method has failed to bind the parameter because the database state has not been reset
221 * after executing the SELECT query by using Database::ExecuteStatementN() or DbEnumerator::MoveNext(). @n
222 * In this case DbEnumerator::Reset() should be invoked before calling this method.
224 result BindBlob(int columnIndex, const void* buffer, int size);
227 * Binds the specified DateTime value to the statement parameter.
230 * @brief <i> [Compatibility] </i>
234 * @compatibility This method has compatibility issues with OSP compatible applications. @n
235 * For more information, see @ref CompDatabaseExceptionPage "here".
238 * @return An error code
239 * @param[in] columnIndex The index of the column to bind the value
240 * @param[out] value The date value to bind
241 * @exception E_SUCCESS The method is successful.
242 * @exception E_INVALID_STATE Either of the following conditions has occurred:
243 * - The instance has not been properly constructed.
244 * - The instance is finalized.
245 * @exception E_INVALID_ARG Either of the following conditions has occurred:
246 * - The specified @c columnIndex is invalid.
247 * - The value is less than @c or a @c null pointer.
248 * @exception E_INVALID_OPERATION This method has failed to bind the parameter because the database state has not been reset
249 * after executing the SELECT query by using Database::ExecuteStatementN() or DbEnumerator::MoveNext(). @n
250 * In this case DbEnumerator::Reset() should be invoked before calling this method.
252 result BindDateTime(int columnIndex, const Tizen::Base::DateTime& value);
255 * Binds a @c null value to the statement parameter.
258 * @brief <i> [Compatibility] </i>
262 * @compatibility This method has compatibility issues with OSP compatible applications. @n
263 * For more information, see @ref CompDatabaseExceptionPage "here".
266 * @return An error code
267 * @param[in] columnIndex The index of the column to bind the @c null value
268 * @exception E_SUCCESS The method is successful.
269 * @exception E_INVALID_STATE Either of the following conditions has occurred:
270 * - The instance has not been properly constructed.
271 * - The instance is finalized.
272 * @exception E_INVALID_ARG The specified @c columnIndex is invalid.
273 * @exception E_INVALID_OPERATION This method has failed to bind the parameter because the database state has not been reset
274 * after executing the SELECT query by using Database::ExecuteStatementN() or DbEnumerator::MoveNext(). @n
275 * In this case DbEnumerator::Reset() should be invoked before calling this method.
277 result BindNull(int columnIndex);
281 * This default constructor is intentionally declared as private so that only the platform can create an instance.
288 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
292 DbStatement(const DbStatement& rhs);
295 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
299 DbStatement& operator =(const DbStatement& rhs);
301 class _DbStatementImpl* __pDbStatementImpl;
303 friend class _DbStatementImpl;
309 #endif //_FIO_DB_STATEMENT_H_