update tizen source
[framework/messaging/msg-service.git] / framework / storage-handler / MsgStorageMms.cpp
1 /*
2 *
3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
4 *
5 * This file is part of msg-service.
6 *
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 *          Sangkoo Kim <sangkoo.kim@samsung.com>
9 *          Seunghwan Lee <sh.cat.lee@samsung.com>
10 *          SoonMin Jung <sm0415.jung@samsung.com>
11 *          Jae-Young Lee <jy4710.lee@samsung.com>
12 *          KeeBum Kim <keebum.kim@samsung.com>
13 *
14 * PROPRIETARY/CONFIDENTIAL
15 *
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
21 *
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
28 *
29 */
30
31 #include "MsgDebug.h"
32 #include "MsgCppTypes.h"
33 #include "MsgUtilFile.h"
34 #include "MsgUtilStorage.h"
35 #include "MsgSqliteWrapper.h"
36 #include "MsgStorageHandler.h"
37 #include "MsgContact.h"
38
39
40 /*==================================================================================================
41                                      VARIABLES
42 ==================================================================================================*/
43 extern MsgDbHandler dbHandle;
44
45
46 /*==================================================================================================
47                                      FUNCTION IMPLEMENTATION
48 ==================================================================================================*/
49 MSG_ERROR_T MsgStoGetText(MSG_MESSAGE_ID_T MsgId, char *pSubject, char *pMsgText)
50 {
51         char sqlQuery[MAX_QUERY_LEN+1];
52
53         memset(sqlQuery, 0x00, sizeof(sqlQuery));
54
55         snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SUBJECT, MSG_TEXT FROM %s WHERE MSG_ID = %d;",
56                                         MSGFW_MESSAGE_TABLE_NAME, MsgId);
57
58         if(dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
59                 return MSG_ERR_DB_PREPARE;
60
61         if(dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
62
63                 char *subject = (char*)dbHandle.columnText(0);
64                 char *text = (char*)dbHandle.columnText(1);
65
66                 if(subject)
67                         strncpy(pSubject, subject, MAX_SUBJECT_LEN);
68                 if(text)
69                         strncpy(pMsgText, text, MAX_MSG_TEXT_LEN);
70         } else {
71                 dbHandle.finalizeQuery();
72                 return MSG_ERR_DB_STEP;
73         }
74
75         dbHandle.finalizeQuery();
76
77         return MSG_SUCCESS;
78
79 }
80
81
82
83 MSG_ERROR_T MsgStoUpdateMMSMessage(MSG_MESSAGE_INFO_S *pMsg)
84 {
85         MSG_BEGIN();
86
87         MSG_ERROR_T err = MSG_SUCCESS;
88         int rowCnt = 0;
89         char sqlQuery[MAX_QUERY_LEN+1];
90
91         memset(sqlQuery, 0x00, sizeof(sqlQuery));
92
93         dbHandle.beginTrans();
94
95         if(pMsg->msgType.subType == MSG_RETRIEVE_AUTOCONF_MMS || pMsg->msgType.subType == MSG_RETRIEVE_MANUALCONF_MMS)
96         {
97                 if( pMsg->networkStatus == MSG_NETWORK_RETRIEVE_SUCCESS )
98                 {
99                         snprintf(sqlQuery, sizeof(sqlQuery),
100                                 "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, DISPLAY_TIME = %lu, SUBJECT = ?, NETWORK_STATUS = %d, MSG_TEXT = ?, THUMB_PATH = '%s', DATA_SIZE = %d WHERE REFERENCE_ID = %d;",
101                                         MSGFW_MESSAGE_TABLE_NAME, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->displayTime, pMsg->networkStatus, pMsg->thumbPath,  pMsg->dataSize, pMsg->msgId);
102
103                         if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
104                                 return MSG_ERR_DB_PREPARE;
105
106                         dbHandle.bindText(pMsg->subject, 1);
107                         dbHandle.bindText(pMsg->msgText, 2);
108                 }
109                 else if( pMsg->networkStatus == MSG_NETWORK_RETRIEVE_FAIL)
110                 {
111                         snprintf(sqlQuery, sizeof(sqlQuery),
112                                 "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, SUBJECT = ?, NETWORK_STATUS = %d, MSG_TEXT = ?, THUMB_PATH = '%s' WHERE REFERENCE_ID = %d;",
113                                         MSGFW_MESSAGE_TABLE_NAME, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->networkStatus, pMsg->thumbPath,  pMsg->msgId);
114
115                         if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
116                                 return MSG_ERR_DB_PREPARE;
117
118                         dbHandle.bindText(pMsg->subject, 1);
119                         dbHandle.bindText(pMsg->msgText, 2);
120                 }
121         }
122         else if (pMsg->msgType.subType == MSG_SENDREQ_MMS)
123         {
124                 snprintf(sqlQuery, sizeof(sqlQuery),
125                         "UPDATE %s SET MSG_DATA = '%s', MSG_TEXT = ?, THUMB_PATH = '%s' WHERE REFERENCE_ID = %d;",
126                                 MSGFW_MESSAGE_TABLE_NAME, pMsg->msgData, pMsg->thumbPath, pMsg->referenceId);
127
128                 if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
129                         return MSG_ERR_DB_PREPARE;
130
131                 dbHandle.bindText(pMsg->msgText, 1);
132         }
133         else
134         {
135                 snprintf(sqlQuery, sizeof(sqlQuery),
136                         "UPDATE %s SET MAIN_TYPE = %d, SUB_TYPE = %d, FOLDER_ID = %d, NETWORK_STATUS = %d WHERE REFERENCE_ID = %d;",
137                                                 MSGFW_MESSAGE_TABLE_NAME, pMsg->msgType.mainType, pMsg->msgType.subType, pMsg->folderId, pMsg->networkStatus, pMsg->msgId);
138
139                 if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
140                         return MSG_ERR_DB_PREPARE;
141         }
142
143         if (dbHandle.stepQuery() != MSG_ERR_DB_DONE)
144         {
145                 dbHandle.finalizeQuery();
146                 dbHandle.endTrans(false);
147                 MSG_DEBUG("Update MMS Message. Fail [%s]", sqlQuery);
148                 return MSG_ERR_DB_STEP;
149         }
150
151         dbHandle.finalizeQuery();
152
153         unsigned int addrId = 0;
154
155         memset(sqlQuery, 0x00, sizeof(sqlQuery));
156
157         // Get SUB_TYPE, STORAGE_ID
158         memset(sqlQuery, 0x00, sizeof(sqlQuery));
159         snprintf(sqlQuery, sizeof(sqlQuery),
160                 "SELECT ADDRESS_ID \
161                                         FROM %s \
162                                      WHERE MSG_ID = %d;",
163                                 MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
164
165         if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
166         {
167                 dbHandle.endTrans(false);
168                 return MSG_ERR_DB_PREPARE;
169         }
170
171         if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
172         {
173                 addrId = dbHandle.columnInt(0);
174
175                 MSG_DEBUG("AddressId:[%d]", addrId);
176         }
177         else
178         {
179                 MSG_DEBUG("MsgStepQuery() Error [%s]", sqlQuery);
180                 dbHandle.finalizeQuery();
181                 dbHandle.endTrans(false);
182                 return MSG_ERR_DB_STEP;
183         }
184
185         dbHandle.finalizeQuery();
186
187         memset(sqlQuery, 0x00, sizeof(sqlQuery));
188         snprintf(sqlQuery, sizeof(sqlQuery),
189                 "SELECT ADDRESS_ID \
190                                         FROM %s \
191                                      WHERE REFERENCE_ID = %d;",
192                                 MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
193
194         err = dbHandle.getTable(sqlQuery, &rowCnt);
195
196         if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
197         {
198                 MSG_DEBUG("Failed to Get Table");
199
200                 dbHandle.freeTable();
201                 dbHandle.endTrans(false);
202
203                 return MSG_ERR_STORAGE_ERROR;
204         }
205
206         for (int i = 1; i <= rowCnt; i++)
207         {
208                 addrId = dbHandle.getColumnToInt(i);
209
210                 if (MsgStoUpdateAddress(&dbHandle, addrId) != MSG_SUCCESS)
211                 {
212                         MSG_DEBUG("MsgStoUpdateAddress() Error");
213                         dbHandle.freeTable();
214                         dbHandle.endTrans(false);
215
216                         return MSG_ERR_STORAGE_ERROR;
217                 }
218         }
219
220         dbHandle.freeTable();
221
222         dbHandle.endTrans(true);
223
224         MSG_END();
225
226         return MSG_SUCCESS;
227 }
228
229
230 MSG_ERROR_T MsgStoGetContentLocation(MSG_MESSAGE_INFO_S* pMsgInfo)
231 {
232         char sqlQuery[MAX_QUERY_LEN+1];
233
234         memset(sqlQuery, 0x00, sizeof(sqlQuery));
235
236         snprintf(sqlQuery, sizeof(sqlQuery), "SELECT CONTENTS_LOCATION FROM %s WHERE REFERENCE_ID IN \
237                                                 (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
238                                                 MMS_PLUGIN_MESSAGE_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
239
240         if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
241                 return MSG_ERR_DB_PREPARE;
242
243         if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
244         {
245                 if (dbHandle.columnText(0) != NULL)
246                 {
247                         strncpy(pMsgInfo->msgData, (char*)dbHandle.columnText(0), MAX_MSG_DATA_LEN);
248                         pMsgInfo->dataSize = strlen(pMsgInfo->msgData);
249                 }
250                 else
251                 {
252                         dbHandle.finalizeQuery();
253                         return MSG_ERR_DB_NORECORD;
254                 }
255         }
256         else
257         {
258                 dbHandle.finalizeQuery();
259                 return MSG_ERR_DB_STEP;
260         }
261
262         dbHandle.finalizeQuery();
263
264         return MSG_SUCCESS;
265 }
266
267
268 MSG_ERROR_T MsgStoSetReadReportSendStatus(MSG_MESSAGE_ID_T msgId, int readReportSendStatus)
269 {
270         bool bReadReportSent = false;
271
272         if((MmsRecvReadReportSendStatus)readReportSendStatus == MMS_RECEIVE_READ_REPORT_SENT)
273                 bReadReportSent = true;
274         else
275                 bReadReportSent = false;
276
277         char sqlQuery[MAX_QUERY_LEN+1];
278
279         memset(sqlQuery, 0x00, sizeof(sqlQuery));
280
281         snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET READ_REPORT_SEND_STATUS = %d, READ_REPORT_SENT = %d WHERE REFERENCE_ID IN \
282                                         (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
283                                         MMS_PLUGIN_ATTRIBUTE_TABLE_NAME, (MmsRecvReadReportSendStatus)readReportSendStatus, (int)bReadReportSent,
284                                         MSGFW_MESSAGE_TABLE_NAME, msgId);
285
286         if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
287                 return MSG_ERR_DB_EXEC;
288
289         return MSG_SUCCESS;
290 }
291
292
293 MSG_ERROR_T MsgStoGetOrgAddressList(MSG_MESSAGE_INFO_S *pMsg)
294 {
295         MSG_ERROR_T err = MSG_SUCCESS;
296         char sqlQuery[MAX_QUERY_LEN+1];
297         int referenceId = 0;
298         int rowCnt = 0;
299         int index = 3;
300
301         memset(sqlQuery, 0x00, sizeof(sqlQuery));
302         snprintf(sqlQuery, sizeof(sqlQuery), "SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d;", MSGFW_MESSAGE_TABLE_NAME, pMsg->msgId);
303
304         if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
305                 return MSG_ERR_DB_PREPARE;
306
307         if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
308                 referenceId = dbHandle.columnInt(0);
309
310         dbHandle.finalizeQuery();
311
312         memset(sqlQuery, 0x00, sizeof(sqlQuery));
313         snprintf(sqlQuery, sizeof(sqlQuery), "SELECT ADDRESS_TYPE, RECIPIENT_TYPE, ADDRESS_VAL FROM %s WHERE ADDRESS_ID IN \
314                                 (SELECT ADDRESS_ID FROM %s WHERE REFERENCE_ID = %d);",
315                                 MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, referenceId);
316
317         err = dbHandle.getTable(sqlQuery, &rowCnt);
318
319         if (err != MSG_SUCCESS && err != MSG_ERR_DB_NORECORD)
320         {
321                 dbHandle.freeTable();
322                 return err;
323         }
324
325         for(int i = 0; i < rowCnt; i++)
326         {
327                 pMsg->addressList[i].addressType = dbHandle.getColumnToInt(index++);
328                 pMsg->addressList[i].recipientType = dbHandle.getColumnToInt(index++);
329                 dbHandle.getColumnToString(index++, MAX_ADDRESS_VAL_LEN, pMsg->addressList[i].addressVal);
330         }
331
332         pMsg->nAddressCnt = rowCnt;
333
334         dbHandle.freeTable();
335
336         return MSG_SUCCESS;
337 }
338
339
340 MSG_ERROR_T MsgStoGetSubject(MSG_MESSAGE_ID_T MsgId, char *pSubject)
341 {
342         char sqlQuery[MAX_QUERY_LEN+1];
343
344         memset(sqlQuery, 0x00, sizeof(sqlQuery));
345
346         snprintf(sqlQuery, sizeof(sqlQuery), "SELECT SUBJECT FROM %s WHERE MSG_ID = %d;",
347                                 MSGFW_MESSAGE_TABLE_NAME, MsgId);
348
349         if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
350                 return MSG_ERR_DB_PREPARE;
351
352         if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
353         {
354                 strncpy(pSubject, (char*)dbHandle.columnText(0), MAX_SUBJECT_LEN);
355         }
356         else
357         {
358                 dbHandle.finalizeQuery();
359                 return MSG_ERR_DB_STEP;
360         }
361
362         dbHandle.finalizeQuery();
363
364         return MSG_SUCCESS;
365 }
366
367
368 MSG_ERROR_T MsgStoUpdateNetworkStatus(MSG_MESSAGE_INFO_S *pMsgInfo, MSG_NETWORK_STATUS_T Status)
369 {
370         MSG_BEGIN();
371
372         MSG_ERROR_T err = MSG_SUCCESS;
373
374         char sqlQuery[MAX_QUERY_LEN+1];
375
376         memset(sqlQuery, 0x00, sizeof(sqlQuery));
377
378         snprintf(sqlQuery, sizeof(sqlQuery), "UPDATE %s SET NETWORK_STATUS = %d WHERE REFERENCE_ID IN \
379                                                 (SELECT REFERENCE_ID FROM %s WHERE MSG_ID = %d);",
380                                                 MSGFW_MESSAGE_TABLE_NAME, Status,
381                                                 MSGFW_MESSAGE_TABLE_NAME, pMsgInfo->msgId);
382
383         if (dbHandle.execQuery(sqlQuery) != MSG_SUCCESS)
384                 return MSG_ERR_DB_EXEC;
385
386         MSG_END();
387
388         return err;
389 }
390
391
392 MSG_ERROR_T MsgStoGetRecipientList(MSG_MESSAGE_ID_T msgId, MSG_RECIPIENTS_LIST_S *pRecipientList)
393 {
394         if (pRecipientList == NULL)
395         {
396                 MSG_DEBUG("pRecipientList is NULL");
397                 return MSG_ERR_NULL_POINTER;
398         }
399
400         int rowCnt = 0, index = 7;
401
402         char sqlQuery[MAX_QUERY_LEN+1];
403
404         memset(sqlQuery, 0x00, sizeof(sqlQuery));
405
406         snprintf(sqlQuery, sizeof(sqlQuery), "SELECT B.ADDRESS_TYPE, B.RECIPIENT_TYPE, B.ADDRESS_VAL, B.CONTACT_ID, \
407                                         B.DISPLAY_NAME, B.FIRST_NAME, B.LAST_NAME \
408                                         FROM %s A, %s B \
409                                      WHERE A.MSG_ID = %d \
410                                           AND A.ADDRESS_ID = B.ADDRESS_ID;",
411                                 MSGFW_MESSAGE_TABLE_NAME, MSGFW_ADDRESS_TABLE_NAME, msgId);
412
413         if (dbHandle.getTable(sqlQuery, &rowCnt) != MSG_SUCCESS)
414         {
415                 dbHandle.freeTable();
416                 return MSG_ERR_DB_GETTABLE;
417         }
418
419         pRecipientList->recipientCnt= rowCnt;
420
421         MSG_DEBUG("pRecipientList->recipientCnt [%d]", pRecipientList->recipientCnt);
422
423         pRecipientList->recipientAddr= (MSG_ADDRESS_INFO_S*)new char[sizeof(MSG_ADDRESS_INFO_S)*rowCnt];
424
425         MSG_ADDRESS_INFO_S* pTmp = pRecipientList->recipientAddr;
426
427         char firstName[MAX_THREAD_NAME_LEN+1], lastName[MAX_THREAD_NAME_LEN+1];
428         char displayName[MAX_DISPLAY_NAME_LEN+1];
429
430         int order = MsgGetContactNameOrder();
431
432         for (int i = 0; i < rowCnt; i++)
433         {
434                 pTmp->threadId = 0;
435
436                 pTmp->addressType = dbHandle.getColumnToInt(index++);
437                 pTmp->recipientType= dbHandle.getColumnToInt(index++);
438
439                 memset(pTmp->addressVal, 0x00, sizeof(pTmp->addressVal));
440                 dbHandle.getColumnToString(index++, MAX_ADDRESS_VAL_LEN, pTmp->addressVal);
441
442                 pTmp->contactId= dbHandle.getColumnToInt(index++);
443
444                 memset(displayName, 0x00, sizeof(displayName));
445                 dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, displayName);
446
447                 memset(firstName, 0x00, sizeof(firstName));
448                 dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, firstName);
449
450                 memset(lastName, 0x00, sizeof(lastName));
451                 dbHandle.getColumnToString(index++, MAX_THREAD_NAME_LEN, lastName);
452
453                 if (strlen(displayName) <= 0)
454                 {
455                         if (order == 0)
456                         {
457                                 if (firstName[0] != '\0')
458                                 {
459                                         strncpy(displayName, firstName, MAX_DISPLAY_NAME_LEN);
460                                 }
461
462                                 if (lastName[0] != '\0')
463                                 {
464                                         strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
465                                         strncat(displayName, lastName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
466                                 }
467                         }
468                         else if (order == 1)
469                         {
470                                 if (lastName[0] != '\0')
471                                 {
472                                         strncpy(displayName, lastName, MAX_DISPLAY_NAME_LEN);
473                                         strncat(displayName, " ", MAX_DISPLAY_NAME_LEN-strlen(displayName));
474                                 }
475
476                                 if (firstName[0] != '\0')
477                                 {
478                                         strncat(displayName, firstName, MAX_DISPLAY_NAME_LEN-strlen(displayName));
479                                 }
480                         }
481                 }
482
483                 memset(pTmp->displayName, 0x00, sizeof(pTmp->displayName));
484                 strncpy(pTmp->displayName, displayName, MAX_DISPLAY_NAME_LEN);
485
486                 pTmp++;
487         }
488
489         dbHandle.freeTable();
490
491         return MSG_SUCCESS;
492 }
493
494
495 MSG_ERROR_T MsgStoGetReadStatus(MSG_MESSAGE_ID_T MsgId, bool *pReadStatus)
496 {
497         char sqlQuery[MAX_QUERY_LEN+1];
498
499         memset(sqlQuery, 0x00, sizeof(sqlQuery));
500
501         snprintf(sqlQuery, sizeof(sqlQuery), "SELECT READ_STATUS FROM %s WHERE MSG_ID = %d;",
502                                                         MSGFW_MESSAGE_TABLE_NAME, MsgId);
503
504         if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
505                 return MSG_ERR_DB_PREPARE;
506
507         if (dbHandle.stepQuery() == MSG_ERR_DB_ROW)
508         {
509                 *pReadStatus = (bool)dbHandle.columnInt(0);
510         }
511         else
512         {
513                 dbHandle.finalizeQuery();
514                 return MSG_ERR_DB_STEP;
515         }
516
517         dbHandle.finalizeQuery();
518
519         return MSG_SUCCESS;
520 }
521
522
523 MSG_ERROR_T MsgStoGetAddrInfo(MSG_MESSAGE_ID_T MsgId, MSG_ADDRESS_INFO_S *pAddrInfo)
524 {
525         char sqlQuery[MAX_QUERY_LEN+1];
526
527         // Add Address
528         memset(sqlQuery, 0x00, sizeof(sqlQuery));
529
530         snprintf(sqlQuery, sizeof(sqlQuery), "SELECT A.ADDRESS_ID, A.ADDRESS_TYPE, A.RECIPIENT_TYPE, A.CONTACT_ID, A.ADDRESS_VAL \
531                                         FROM %s A, %s B WHERE A.ADDRESS_ID = B.ADDRESS_ID AND B.MSG_ID = %d;",
532                                         MSGFW_ADDRESS_TABLE_NAME, MSGFW_MESSAGE_TABLE_NAME, MsgId);
533
534         if (dbHandle.prepareQuery(sqlQuery) != MSG_SUCCESS)
535                 return MSG_ERR_DB_PREPARE;
536
537         if (dbHandle.stepQuery() == MSG_ERR_DB_ROW) {
538                 pAddrInfo->threadId = dbHandle.columnInt(0);
539                 pAddrInfo->addressType = dbHandle.columnInt(1);
540                 pAddrInfo->recipientType = dbHandle.columnInt(2);
541                 pAddrInfo->contactId = dbHandle.columnInt(3);
542
543                 strncpy(pAddrInfo->addressVal, (char*)dbHandle.columnText(4), MAX_ADDRESS_VAL_LEN);
544         } else {
545                 dbHandle.finalizeQuery();
546                 return MSG_ERR_DB_STEP;
547         }
548
549         dbHandle.finalizeQuery();
550
551         return MSG_SUCCESS;
552 }
553