PDA

View Full Version : what's the relationship between QOCI and OCI ?



silentyears
10th March 2014, 15:16
Hi,
As subject, i know Oracle database provide oci api to access the database while Qt provide the QSql(include the QSqlQuery, QSqlTableModel and so on) to access, what's the relationship between them? Whether the QSql just envelop the oci ? In other words,whether the underlying implementation of QSql is oci?
And if the oci interface is the same on any platform(such as Qt or VC)?
Thanks very much!

ChrisW67
10th March 2014, 20:35
Yes, the QOCI plugin wraps the Oracle supplied OCI library to provide the unified Qt interface.

The Oracle component is a C library. You should be able to use any Qt compatible compiler with that: Microsoft's VC++ or MingW on Windows.

silentyears
11th March 2014, 14:33
Yes, the QOCI plugin wraps the Oracle supplied OCI library to provide the unified Qt interface.

The Oracle component is a C library. You should be able to use any Qt compatible compiler with that: Microsoft's VC++ or MingW on Windows.

Thanks very much!
So there is another question, it's so slow( about 3-5s to 5000 rows ) when i use QOCI to access database(eg. QSqlQuery api) to select the one table which include blob fileds , but it's more fast when i use oci to do the same work.
Why?
When i change QSqlTableMode to access database, i use operation "fetchMore()" to traverse the all rows of table, it's wasting time so much! How can i get over this?

ChrisW67
11th March 2014, 20:12
Do not select the blob field.
The OCI interface does not retrieve the content of the blob until you explicitly fetch its using the lob column value from the result set. The Qt interface actually fetches the data in the blob field for every row.

silentyears
13th March 2014, 12:28
Do not select the blob field.
The OCI interface does not retrieve the content of the blob until you explicitly fetch its using the lob column value from the result set. The Qt interface actually fetches the data in the blob field for every row.

Thanks once again! you're so warm-heart. It's unfortunately that the blob field is just what i need and sometimes i need to get all the rows at once rather than a part of them a time. How to get over this? That as fast as QOCI (or oci) can go?
Thanks!

anda_skoa
13th March 2014, 12:53
I have my doubts that you need all the blobs from all rows at the same time.

What exactly are you doing with those blobs once you have them?

Cheers,
_

silentyears
14th March 2014, 13:29
I have my doubts that you need all the blobs from all rows at the same time.

What exactly are you doing with those blobs once you have them?

Cheers,
_

Thanks first!
Like map information, each blob is a line consisted of so many points represent road or river, and info of several tables is current info need to show on screen at a time.
So i need to select whole table at once.