title: Speeding up Oracle database interface in Qt (QOCI)
body: <p>I have a project that involves integrating an Oracle database into a Qt desktop app. Since Qt has a really easy to use interface for database interaction, I compiled the QOCI driver to support Oracle connections.</p>
  
  <p>Everything works fine, but the processing time for queries is incredibly slow. How can I improve performance?</p>
  
  <p>My code for processing an arbitrary query looks like this:</p>
  
  <pre><code>QList&lt; QList&lt;QString&gt; &gt; DBWrapper::executeQuery(QString const&amp; queryString)
  {
      QList&lt; QList&lt;QString&gt; &gt; results;
      if (_db.isOpen()) {
          QSqlQuery qry(queryString);
          if(qry.exec()) {
              while(qry.next()) {
                  QList&lt;QString&gt; row;
                  results.append(row);
                  for(int i = 0; i &lt; qry.record().count(); ++i) {
                      results.last().append(qry.value(i).toString());
                  }
              }
          } else {
              qDebug() &lt;&lt; queryString;
              qDebug() &lt;&lt; "FAILURE: cannot handle query.";
              qDebug() &lt;&lt; "  &gt; " &lt;&lt; qry.lastError();
          }
      } else {
          qDebug() &lt;&lt; "Error Opening Database = " &lt;&lt; _db.lastError();
      }
  
      return results;
  }
  </code></pre>