+result PresentationModelBase::ExecuteUpdateHistoryFavIconQuery(const Tizen::Base::String& formatQuery, int& nRowCount, History& history)
+{
+ result r = E_FAILURE;
+ String queryType;
+ int historyID;
+ r = Integer::Parse(history.GetHistoryId(), historyID);
+
+ if (__pDataBase == null)
+ {
+ return E_INIT_FAILED;
+ }
+
+ if (__pDbEnum != null)
+ {
+ delete __pDbEnum;
+ __pDbEnum = null;
+ }
+
+ if (__pDbStatement != null)
+ {
+ delete __pDbStatement;
+ __pDbStatement = null;
+ }
+ r = formatQuery.SubString(0, QUERY_TYPE_LENGTH, queryType);
+
+ if (__isBeginTransaction == false )
+ {
+ r = __pDataBase->BeginTransaction();
+ if (IsFailed(r))
+ {
+ AppLogException("Failed Database::BeginTransaction() . (error: %s)", GetErrorMessage(r));
+ return r;
+ }
+
+ __isBeginTransaction = true;
+ __pDbStatement = __pDataBase->CreateStatementN(formatQuery);
+ if(GetLastResult() != E_SUCCESS)
+ {
+ AppLog("CreateStatementN error: %s", GetErrorMessage(GetLastResult()));
+ return GetLastResult();
+ }
+ __pDbStatement->BindBlob(0,*(history.GetFavIconBuffer()));
+ __pDbStatement->BindInt(1,history.GetFavIconWidth());
+ __pDbStatement->BindInt(2,history.GetFavIconHeight());
+ __pDbStatement->BindInt(3,historyID);
+
+ __pDataBase->ExecuteStatementN(*__pDbStatement);
+
+ if (IsFailed(GetLastResult()))
+ {
+ AppLog("PresentationModelBase::ExecuteBookmarkQuery Failed Database::ExecuteSql(). (error: %s, query: %ls)", GetErrorMessage(r), formatQuery.GetPointer());
+ return r;
+ }
+ else
+ {
+ AppLog("PresentationModelBase::ExecuteBookmarkQuery success database");
+ }
+ }
+
+ return r;
+}
+