PDA

View Full Version : Qt Sql Features



lk
14th February 2013, 17:30
Hello,

While considering using Qt lgpl free license for its Qt Sql module, I wondered if you could answer some of the following questions:

1. Does QtSql support MsSql and Sybase database types, including support for stored procedures?
2. Does it utilize native bulk write apis for bulk write
3. Can you specify a list of companies using QtSql
4. Licensing, is it possible to change the code? what is the procedure for changing the code?
5. Can a product use the library without exposing its source code?
6. Support, suppose there is some problem, can there be support for the lgpl free license?
7. Is there a community of users for the free lgpl version
8. Can the library compile for Solaris, AIX and HP-UX?
9. How complicated is it to add support for native sybase ct-lib and MsSql ole-db to QtSql?

Thanks
lk

Santosh Reddy
14th February 2013, 18:38
1. Does QtSql support MsSql and Sybase database types, including support for stored procedures?
Here is list of supported databases Link (http://qt-project.org/doc/qt-4.8/sql-driver.html)

2. Does it utilize native bulk write apis for bulk write
Not sure what this means, if you mean BLOB, it depends the driver, if driver supported then yes.

3. Can you specify a list of companies using QtSql
This may be not practically possible, I will say most of the companies that Qt it self.

4. Licensing, is it possible to change the code? what is the procedure for changing the code?
LPGL does not allow to change the code. If change to code is required, go for GPL/Commercial Lic

5. Can a product use the library without exposing its source code?
Using LGPL user code need not be exposed, provided other requirement of LGPL are met

6. Support, suppose there is some problem, can there be support for the lgpl free license?
Forum like this and other are the places you an get help, or hire a Qt Expert.

7. Is there a community of users for the free lgpl version
Generally forums/community does not care about the licenses, it is only a technical place. But there may be some commercial license portals which may not be meant for GPL/LPGL license users

8. Can the library compile for Solaris, AIX and HP-UX?
Using LGPL, you cannot do that, all you can do is get the pre-built libraries from the qt-project.org.
Here is list of supported platforms Link (http://qt-project.org/doc/qt-4.8/supported-platforms.html)

9. How complicated is it to add support for native sybase ct-lib and MsSql ole-db to QtSql?
I will try put to put in kind of equation

T = A + B * C;

T - Total
A - Knowledge of QtCore classes
B - Knowledge of native database interface (libs)
C - Knowledge of QtSql classes

More details of about how to write driver is here Link (http://qt-project.org/doc/qt-4.8/sql-driver.html)

Lykurg
14th February 2013, 18:59
LPGL does not allow to change the code. If change to code is required, go for GPL/Commercial Lic
You can change the code with LGPL but you have to publish that changes.


Using LGPL, you cannot do that, all you can do is get the pre-built libraries from the qt-project.org.
This is also not true. You can also build from sources for any platform. From the configure scriptelif [ $COMMERCIAL_USER = "no" ]; then
# Open Source edition - may only be used under the terms of the GPL or LGPL.
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
Licensee="Open Source"
Edition="OpenSource"
EditionString="Open Source"
QT_EDITION="QT_EDITION_OPENSOURCE"
fi

Santosh Reddy
14th February 2013, 19:43
Thanks for correcting me, It is been a while I dealt with licenses :)

lk
15th February 2013, 19:54
Thank you for the quick response

about

Here is list of supported databases Link
The link states that there was a Sybase driver named QTDS but it is obsolete from Qt 4.7

Instead, there is the QODBC driver which can be used as a fallback for compliant databases, the question is whether Sybase can be used with this QODBC driver?

Santosh Reddy
15th February 2013, 20:52
the question is whether Sybase can be used with this QODBC driver?
This would be a question to Sybase support system. Does Sybase drivers support ODBC interface?

wysota
15th February 2013, 22:58
Hello,

While considering using Qt lgpl free license for its Qt Sql module, I wondered if you could answer some of the following questions:

1. Does QtSql support MsSql and Sybase database types, including support for stored procedures?
2. Does it utilize native bulk write apis for bulk write
3. Can you specify a list of companies using QtSql
4. Licensing, is it possible to change the code? what is the procedure for changing the code?
5. Can a product use the library without exposing its source code?
6. Support, suppose there is some problem, can there be support for the lgpl free license?
7. Is there a community of users for the free lgpl version
8. Can the library compile for Solaris, AIX and HP-UX?
9. How complicated is it to add support for native sybase ct-lib and MsSql ole-db to QtSql?

If you guys don't mind, I will try to answer those questions again from a bit different perspective.

QtSql provides a driver-agnostic interface to relational databases. It supports the common denominator of different SQL systems and dialects which basically means ANSI SQL. Support for particular database systems is provided by drivers that implement a given set of interfaces that the main library then uses to communicate with the database. One of the functions of the driver is to execute any possible SQL statement that may or may not return a result in a form of a set of records. Each driver can decide to implement more than the common denominator if the interface for QSqlDriver allows it. Furthermore totally custom things can be done by extracting the native handle to the low-level driver and using its API to access functions of that driver if it is acceptable that the application will not work with any other database system. You can even implement your own database driver if you have some custom database system that understands SQL. On the other hand if you are certain that your program is going to be tied to a particular DBMS (e.g. MsSql) and you need a wide range of functionality, it might be easier for you to use the native API of that DBMS directly without going through QtSql. To stress again, the aim of this library is to provide an abstract way to access different DBMS.

Qt can be built for Solaris, AIX and HP-UX. Whether a particular SQL driver can build for a particular OS depends on this driver. The only difference between LGPL and commercial editions of Qt regarding SQL is that the latter does (or at least used to) come with prebuild OCI driver for Oracle.

lk
18th February 2013, 10:35
Another features question is related to CLob/Text type support

Can you specify which drivers support Text/CLob data types?

More specifically, out of the drivers for Oracle, PostgreSql and ODBC (MsSql and Sybase)

Thanks
lk

wysota
18th February 2013, 10:47
Drivers don't care much about data types as long as they can be converted to something QVariant understands. Whether a particular driver understands a particular type, you can check in the sourcecode for that driver.

lk
19th February 2013, 15:30
While looking in drivers source code for CLOB support, I noticed that in the ODBC driver QODBCDriver::hasFeature, the BLOB feature is enabled only if the DBMS is MySql


case BLOB: {
if(d->isMySqlServer)
return true;
else
return false;
}

Does that mean that CLOB is not supported for ODBC MsSql?

How difficult will it be to add support for CLOB in ODBC MsSql?

Thanks
lk

wysota
19th February 2013, 16:02
Does that mean that CLOB is not supported for ODBC MsSql?
No, it means BLOB is only supported on MySql. It doesn't say anything about CLOB.

lk
19th February 2013, 19:16
I have an additional thread safety question

Suppose I create a connection using QSqlDatabase in a thread, then perform a set of operations synchronously, and after all these operations are complete, use the same connection from another thread

Can such actions cause thread-safety issues?

Thanks
lk

Lykurg
19th February 2013, 19:31
Yes. Only use a connection in that thread where you have established the connection.