diff options
Diffstat (limited to 'src/plugins/sqldrivers')
32 files changed, 932 insertions, 0 deletions
diff --git a/src/plugins/sqldrivers/README b/src/plugins/sqldrivers/README new file mode 100644 index 0000000000..7000fb5613 --- /dev/null +++ b/src/plugins/sqldrivers/README @@ -0,0 +1,5 @@ +Please note that the DB2, Oracle and TDS client drivers are not distributed +with the Qt Open Source Editions. + +This is because the client libraries are distributed under a license which +is not compatible with the GPL license. diff --git a/src/plugins/sqldrivers/db2/README b/src/plugins/sqldrivers/db2/README new file mode 100644 index 0000000000..5bebe6a3f9 --- /dev/null +++ b/src/plugins/sqldrivers/db2/README @@ -0,0 +1,6 @@ +You will need IBM DB2 development headers and libraries installed before +compiling this plugin. + +See the Qt SQL documentation for more information on compiling Qt SQL +driver plugins (sql-driver.html). + diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro new file mode 100644 index 0000000000..e053f3756b --- /dev/null +++ b/src/plugins/sqldrivers/db2/db2.pro @@ -0,0 +1,6 @@ +TARGET = qsqldb2 + +SOURCES = main.cpp +include(../../../sql/drivers/db2/qsql_db2.pri) + +include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/db2/main.cpp b/src/plugins/sqldrivers/db2/main.cpp new file mode 100644 index 0000000000..c6cdfb31b4 --- /dev/null +++ b/src/plugins/sqldrivers/db2/main.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#include "../../../sql/drivers/db2/qsql_db2.h" + +QT_BEGIN_NAMESPACE + +class QDB2DriverPlugin : public QSqlDriverPlugin +{ +public: + QDB2DriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QDB2DriverPlugin::QDB2DriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QDB2DriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QDB2")) { + QDB2Driver* driver = new QDB2Driver(); + return driver; + } + return 0; +} + +QStringList QDB2DriverPlugin::keys() const +{ + QStringList l; + l.append(QLatin1String("QDB2")); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QDB2DriverPlugin) +Q_EXPORT_PLUGIN2(qsqldb2, QDB2DriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/ibase/ibase.pro b/src/plugins/sqldrivers/ibase/ibase.pro new file mode 100644 index 0000000000..7870ec8465 --- /dev/null +++ b/src/plugins/sqldrivers/ibase/ibase.pro @@ -0,0 +1,6 @@ +TARGET = qsqlibase + +SOURCES = main.cpp +include(../../../sql/drivers/ibase/qsql_ibase.pri) + +include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/ibase/main.cpp b/src/plugins/sqldrivers/ibase/main.cpp new file mode 100644 index 0000000000..a0553d5dc8 --- /dev/null +++ b/src/plugins/sqldrivers/ibase/main.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#include "../../../sql/drivers/ibase/qsql_ibase.h" + +QT_BEGIN_NAMESPACE + +class QIBaseDriverPlugin : public QSqlDriverPlugin +{ +public: + QIBaseDriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QIBaseDriverPlugin::QIBaseDriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QIBaseDriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QIBASE")) { + QIBaseDriver* driver = new QIBaseDriver(); + return driver; + } + return 0; +} + +QStringList QIBaseDriverPlugin::keys() const +{ + QStringList l; + l << QLatin1String("QIBASE"); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QIBaseDriverPlugin) +Q_EXPORT_PLUGIN2(qsqlibase, QIBaseDriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/mysql/README b/src/plugins/sqldrivers/mysql/README new file mode 100644 index 0000000000..d1b372282d --- /dev/null +++ b/src/plugins/sqldrivers/mysql/README @@ -0,0 +1,6 @@ +You will need the MySQL development headers and libraries installed +before compiling this plugin. + +See the Qt SQL documentation for more information on compiling Qt SQL +driver plugins (sql-driver.html). + diff --git a/src/plugins/sqldrivers/mysql/main.cpp b/src/plugins/sqldrivers/mysql/main.cpp new file mode 100644 index 0000000000..b86baa5729 --- /dev/null +++ b/src/plugins/sqldrivers/mysql/main.cpp @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#include "../../../sql/drivers/mysql/qsql_mysql.h" + +QT_BEGIN_NAMESPACE + +class QMYSQLDriverPlugin : public QSqlDriverPlugin +{ +public: + QMYSQLDriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QMYSQLDriverPlugin::QMYSQLDriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QMYSQLDriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QMYSQL") || name == QLatin1String("QMYSQL3")) { + QMYSQLDriver* driver = new QMYSQLDriver(); + return driver; + } + return 0; +} + +QStringList QMYSQLDriverPlugin::keys() const +{ + QStringList l; + l << QLatin1String("QMYSQL3"); + l << QLatin1String("QMYSQL"); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QMYSQLDriverPlugin) +Q_EXPORT_PLUGIN2(qsqlmysql, QMYSQLDriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/mysql/mysql.pro b/src/plugins/sqldrivers/mysql/mysql.pro new file mode 100644 index 0000000000..b6d42fffc8 --- /dev/null +++ b/src/plugins/sqldrivers/mysql/mysql.pro @@ -0,0 +1,6 @@ +TARGET = qsqlmysql + +SOURCES = main.cpp +include(../../../sql/drivers/mysql/qsql_mysql.pri) + +include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/oci/README b/src/plugins/sqldrivers/oci/README new file mode 100644 index 0000000000..97c27c537e --- /dev/null +++ b/src/plugins/sqldrivers/oci/README @@ -0,0 +1,6 @@ +You will need the Oracle development headers and libraries installed +before compiling this plugin. + +See the Qt SQL documentation for more information on compiling Qt SQL +driver plugins (sql-driver.html). + diff --git a/src/plugins/sqldrivers/oci/main.cpp b/src/plugins/sqldrivers/oci/main.cpp new file mode 100644 index 0000000000..ba40f7185f --- /dev/null +++ b/src/plugins/sqldrivers/oci/main.cpp @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#include "../../../sql/drivers/oci/qsql_oci.h" + +QT_BEGIN_NAMESPACE + +class QOCIDriverPlugin : public QSqlDriverPlugin +{ +public: + QOCIDriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QOCIDriverPlugin::QOCIDriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QOCIDriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QOCI") || name == QLatin1String("QOCI8")) { + QOCIDriver* driver = new QOCIDriver(); + return driver; + } + return 0; +} + +QStringList QOCIDriverPlugin::keys() const +{ + QStringList l; + l.append(QLatin1String("QOCI8")); + l.append(QLatin1String("QOCI")); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QOCIDriverPlugin) +Q_EXPORT_PLUGIN2(qsqloci, QOCIDriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/oci/oci.pro b/src/plugins/sqldrivers/oci/oci.pro new file mode 100644 index 0000000000..d7dcce9e35 --- /dev/null +++ b/src/plugins/sqldrivers/oci/oci.pro @@ -0,0 +1,6 @@ +TARGET = qsqloci + +SOURCES = main.cpp +include(../../../sql/drivers/oci/qsql_oci.pri) + +include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/odbc/README b/src/plugins/sqldrivers/odbc/README new file mode 100644 index 0000000000..279aa7f991 --- /dev/null +++ b/src/plugins/sqldrivers/odbc/README @@ -0,0 +1,6 @@ +You will need ODBC development headers and libraries installed before +compiling this plugin. + +See the Qt SQL documentation for more information on compiling Qt SQL +driver plugins (sql-driver.html). + diff --git a/src/plugins/sqldrivers/odbc/main.cpp b/src/plugins/sqldrivers/odbc/main.cpp new file mode 100644 index 0000000000..19650baf4a --- /dev/null +++ b/src/plugins/sqldrivers/odbc/main.cpp @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#include "../../../sql/drivers/odbc/qsql_odbc.h" + +QT_BEGIN_NAMESPACE + +class QODBCDriverPlugin : public QSqlDriverPlugin +{ +public: + QODBCDriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QODBCDriverPlugin::QODBCDriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QODBCDriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QODBC") || name == QLatin1String("QODBC3")) { + QODBCDriver* driver = new QODBCDriver(); + return driver; + } + return 0; +} + +QStringList QODBCDriverPlugin::keys() const +{ + QStringList l; + l.append(QLatin1String("QODBC3")); + l.append(QLatin1String("QODBC")); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QODBCDriverPlugin) +Q_EXPORT_PLUGIN2(qsqlodbc, QODBCDriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro new file mode 100644 index 0000000000..677eb6eedf --- /dev/null +++ b/src/plugins/sqldrivers/odbc/odbc.pro @@ -0,0 +1,6 @@ +TARGET = qsqlodbc + +SOURCES = main.cpp +include(../../../sql/drivers/odbc/qsql_odbc.pri) + +include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/psql/README b/src/plugins/sqldrivers/psql/README new file mode 100644 index 0000000000..86bf16dd25 --- /dev/null +++ b/src/plugins/sqldrivers/psql/README @@ -0,0 +1,6 @@ +You will need the PostgreSQL development headers and libraries installed +before compiling this plugin. + +See the Qt SQL documentation for more information on compiling Qt SQL +driver plugins (sql-driver.html). + diff --git a/src/plugins/sqldrivers/psql/main.cpp b/src/plugins/sqldrivers/psql/main.cpp new file mode 100644 index 0000000000..3c1f2db985 --- /dev/null +++ b/src/plugins/sqldrivers/psql/main.cpp @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#include "../../../sql/drivers/psql/qsql_psql.h" + +QT_BEGIN_NAMESPACE + +class QPSQLDriverPlugin : public QSqlDriverPlugin +{ +public: + QPSQLDriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QPSQLDriverPlugin::QPSQLDriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QPSQLDriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QPSQL") || name == QLatin1String("QPSQL7")) { + QPSQLDriver* driver = new QPSQLDriver(); + return driver; + } + return 0; +} + +QStringList QPSQLDriverPlugin::keys() const +{ + QStringList l; + l.append(QLatin1String("QPSQL7")); + l.append(QLatin1String("QPSQL")); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QPSQLDriverPlugin) +Q_EXPORT_PLUGIN2(qsqlpsql, QPSQLDriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/psql/psql.pro b/src/plugins/sqldrivers/psql/psql.pro new file mode 100644 index 0000000000..8276c0ae90 --- /dev/null +++ b/src/plugins/sqldrivers/psql/psql.pro @@ -0,0 +1,6 @@ +TARGET = qsqlpsql + +SOURCES = main.cpp +include(../../../sql/drivers/psql/qsql_psql.pri) + +include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/qsqldriverbase.pri b/src/plugins/sqldrivers/qsqldriverbase.pri new file mode 100644 index 0000000000..2f6943ab9a --- /dev/null +++ b/src/plugins/sqldrivers/qsqldriverbase.pri @@ -0,0 +1,8 @@ +include(../qpluginbase.pri) +QT = core sql +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/sqldrivers + +target.path += $$[QT_INSTALL_PLUGINS]/sqldrivers +INSTALLS += target + +DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII diff --git a/src/plugins/sqldrivers/sqldrivers.pro b/src/plugins/sqldrivers/sqldrivers.pro new file mode 100644 index 0000000000..83d71e48f2 --- /dev/null +++ b/src/plugins/sqldrivers/sqldrivers.pro @@ -0,0 +1,13 @@ +TEMPLATE = subdirs + +contains(sql-plugins, psql) : SUBDIRS += psql +contains(sql-plugins, mysql) : SUBDIRS += mysql +contains(sql-plugins, odbc) : SUBDIRS += odbc +contains(sql-plugins, tds) : SUBDIRS += tds +contains(sql-plugins, oci) : SUBDIRS += oci +contains(sql-plugins, db2) : SUBDIRS += db2 +contains(sql-plugins, sqlite) : SUBDIRS += sqlite +contains(sql-plugins, sqlite2) : SUBDIRS += sqlite2 +contains(sql-plugins, ibase) : SUBDIRS += ibase + +symbian:contains(CONFIG, system-sqlite): SUBDIRS += sqlite_symbian diff --git a/src/plugins/sqldrivers/sqlite/README b/src/plugins/sqldrivers/sqlite/README new file mode 100644 index 0000000000..899361a6f5 --- /dev/null +++ b/src/plugins/sqldrivers/sqlite/README @@ -0,0 +1,6 @@ +You will need the SQLite development headers and libraries installed +before compiling this plugin. + +See the Qt SQL documentation for more information on compiling Qt SQL +driver plugins (sql-driver.html). + diff --git a/src/plugins/sqldrivers/sqlite/smain.cpp b/src/plugins/sqldrivers/sqlite/smain.cpp new file mode 100644 index 0000000000..d81b7011b5 --- /dev/null +++ b/src/plugins/sqldrivers/sqlite/smain.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#include "../../../../src/sql/drivers/sqlite/qsql_sqlite.h" + +QT_BEGIN_NAMESPACE + +class QSQLiteDriverPlugin : public QSqlDriverPlugin +{ +public: + QSQLiteDriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QSQLiteDriverPlugin::QSQLiteDriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QSQLiteDriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QSQLITE")) { + QSQLiteDriver* driver = new QSQLiteDriver(); + return driver; + } + return 0; +} + +QStringList QSQLiteDriverPlugin::keys() const +{ + QStringList l; + l << QLatin1String("QSQLITE"); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QSQLiteDriverPlugin) +Q_EXPORT_PLUGIN2(qsqlite, QSQLiteDriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro new file mode 100644 index 0000000000..f4c1671a4b --- /dev/null +++ b/src/plugins/sqldrivers/sqlite/sqlite.pro @@ -0,0 +1,8 @@ +TARGET = qsqlite + +SOURCES = smain.cpp +include(../../../sql/drivers/sqlite/qsql_sqlite.pri) + +wince*: DEFINES += HAVE_LOCALTIME_S=0 + +include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/sqlite2/README b/src/plugins/sqldrivers/sqlite2/README new file mode 100644 index 0000000000..899361a6f5 --- /dev/null +++ b/src/plugins/sqldrivers/sqlite2/README @@ -0,0 +1,6 @@ +You will need the SQLite development headers and libraries installed +before compiling this plugin. + +See the Qt SQL documentation for more information on compiling Qt SQL +driver plugins (sql-driver.html). + diff --git a/src/plugins/sqldrivers/sqlite2/smain.cpp b/src/plugins/sqldrivers/sqlite2/smain.cpp new file mode 100644 index 0000000000..9631576725 --- /dev/null +++ b/src/plugins/sqldrivers/sqlite2/smain.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#include "../../../../src/sql/drivers/sqlite2/qsql_sqlite2.h" + +QT_BEGIN_NAMESPACE + +class QSQLite2DriverPlugin : public QSqlDriverPlugin +{ +public: + QSQLite2DriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QSQLite2DriverPlugin::QSQLite2DriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QSQLite2DriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QSQLITE2")) { + QSQLite2Driver* driver = new QSQLite2Driver(); + return driver; + } + return 0; +} + +QStringList QSQLite2DriverPlugin::keys() const +{ + QStringList l; + l << QLatin1String("QSQLITE2"); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QSQLite2DriverPlugin) +Q_EXPORT_PLUGIN2(qsqlite2, QSQLite2DriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/sqlite2/sqlite2.pro b/src/plugins/sqldrivers/sqlite2/sqlite2.pro new file mode 100644 index 0000000000..e6197b9906 --- /dev/null +++ b/src/plugins/sqldrivers/sqlite2/sqlite2.pro @@ -0,0 +1,6 @@ +TARGET = qsqlite2 + +SOURCES = smain.cpp +include(../../../sql/drivers/sqlite2/qsql_sqlite2.pri) + +include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip Binary files differnew file mode 100644 index 0000000000..df7864410a --- /dev/null +++ b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri new file mode 100644 index 0000000000..b7a87f38d8 --- /dev/null +++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pri @@ -0,0 +1,52 @@ +# We just want to include the sqlite3 binaries for Symbian for platforms that do not have them. +!symbian-abld:!symbian-sbsv2 { + !symbian_no_export_sqlite:!exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) { + contains(QMAKE_HOST.os,Windows) { + # Trick on Windows to do a touch on the file, since copy keeps the timestamp. + copyWithTouch = copy /y /b NUL+ + } else { + copyWithTouch = "$$QMAKE_COPY " + } + symbian_sqlite3_zip_file = $$PWD/SQLite3_v9.2.zip + + # The QMAKE_COPY section is to update timestamp on the file. + symbian_sqlite3_header.input = symbian_sqlite3_zip_file + symbian_sqlite3_header.output = sqlite3.h + !isEmpty(MOC_DIR):symbian_sqlite3_header.output = $$MOC_DIR/$$symbian_sqlite3_header.output + symbian_sqlite3_header.CONFIG = combine no_link + symbian_sqlite3_header.dependency_type = TYPE_C + symbian_sqlite3_header.commands = $$QMAKE_UNZIP -j ${QMAKE_FILE_NAME} epoc32/include/stdapis/${QMAKE_FILE_OUT_BASE}.h \ + && $${copyWithTouch}${QMAKE_FILE_OUT_BASE}.h ${QMAKE_FILE_OUT}.tmp \ + && $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.h \ + && $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT} + silent:symbian_sqlite3_header.commands = @echo unzipping $@ && $$symbian_sqlite3_header.commands + QMAKE_EXTRA_COMPILERS += symbian_sqlite3_header + + # The QMAKE_COPY section is to update timestamp on the file. + symbian_sqlite3_dso.input = symbian_sqlite3_zip_file + symbian_sqlite3_dso.output = sqlite3.dso + !isEmpty(OBJECTS_DIR):symbian_sqlite3_dso.output = $$OBJECTS_DIR/$$symbian_sqlite3_dso.output + symbian_sqlite3_dso.CONFIG = combine no_link target_predeps + symbian_sqlite3_dso.commands = $$QMAKE_UNZIP -j ${QMAKE_FILE_NAME} epoc32/release/armv5/lib/${QMAKE_FILE_OUT_BASE}.dso \ + && $${copyWithTouch}${QMAKE_FILE_OUT_BASE}.dso ${QMAKE_FILE_OUT}.tmp \ + && $$QMAKE_DEL_FILE ${QMAKE_FILE_OUT_BASE}.dso \ + && $$QMAKE_MOVE ${QMAKE_FILE_OUT}.tmp ${QMAKE_FILE_OUT} + silent:symbian_sqlite3_dso.commands = @echo unzipping $@ && $$symbian_sqlite3_dso.commands + QMAKE_EXTRA_COMPILERS += symbian_sqlite3_dso + + # Workaround for the fact that make doesn't understand that sqlite3.dso + # is the same as $OBJECTS_DIR/sqlite3.dso + symbian_sqlite3_dso_standalone.target = sqlite3.dso + symbian_sqlite3_dso_standalone.depends = $$symbian_sqlite3_dso.output + QMAKE_EXTRA_TARGETS += symbian_sqlite3_dso_standalone + + symbian_sqlite3_ver_dso.input = symbian_sqlite3_zip_file + symbian_sqlite3_ver_dso.output = sqlite3{00060003}.dso + !isEmpty(OBJECTS_DIR):symbian_sqlite3_ver_dso.output = $$OBJECTS_DIR/$$symbian_sqlite3_ver_dso.output + symbian_sqlite3_ver_dso.CONFIG = $$symbian_sqlite3_dso.CONFIG + symbian_sqlite3_ver_dso.commands = $$symbian_sqlite3_dso.commands + QMAKE_EXTRA_COMPILERS += symbian_sqlite3_ver_dso + + QMAKE_LIBDIR *= $$OBJECTS_DIR + } +} diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro new file mode 100644 index 0000000000..0d233e6d43 --- /dev/null +++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro @@ -0,0 +1,9 @@ +# Use subdirs template to suppress generation of unnecessary files +TEMPLATE = subdirs + +# We just want to export the sqlite3 binaries for Symbian for platforms that do not have them. +symbian-abld|symbian-sbsv2 { + !symbian_no_export_sqlite:!exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) { + BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip" + } +} diff --git a/src/plugins/sqldrivers/tds/README b/src/plugins/sqldrivers/tds/README new file mode 100644 index 0000000000..3d27ed46d2 --- /dev/null +++ b/src/plugins/sqldrivers/tds/README @@ -0,0 +1,6 @@ +You will need the dblib development headers and libraries installed before +compiling this plugin. + +See the Qt SQL documentation for more information on compiling Qt SQL +driver plugins (sql-driver.html). + diff --git a/src/plugins/sqldrivers/tds/main.cpp b/src/plugins/sqldrivers/tds/main.cpp new file mode 100644 index 0000000000..646b2d725a --- /dev/null +++ b/src/plugins/sqldrivers/tds/main.cpp @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#define Q_UUIDIMPL +#include <qsqldriverplugin.h> +#include <qstringlist.h> +#ifdef Q_OS_WIN32 // We assume that MS SQL Server is used. Set Q_USE_SYBASE to force Sybase. +// Conflicting declarations of LPCBYTE in sqlfront.h and winscard.h +#define _WINSCARD_H_ +#include <windows.h> +#endif +#include "../../../sql/drivers/tds/qsql_tds.h" + +QT_BEGIN_NAMESPACE + + +class QTDSDriverPlugin : public QSqlDriverPlugin +{ +public: + QTDSDriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QTDSDriverPlugin::QTDSDriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QTDSDriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QTDS") || name == QLatin1String("QTDS7")) { + QTDSDriver* driver = new QTDSDriver(); + return driver; + } + return 0; +} + +QStringList QTDSDriverPlugin::keys() const +{ + QStringList l; + l.append(QLatin1String("QTDS7")); + l.append(QLatin1String("QTDS")); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QTDSDriverPlugin) +Q_EXPORT_PLUGIN2(qsqltds, QTDSDriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/tds/tds.pro b/src/plugins/sqldrivers/tds/tds.pro new file mode 100644 index 0000000000..b8e8ded321 --- /dev/null +++ b/src/plugins/sqldrivers/tds/tds.pro @@ -0,0 +1,6 @@ +TARGET = qsqltds + +SOURCES = main.cpp +include(../../../sql/drivers/tds/qsql_tds.pri) + +include(../qsqldriverbase.pri) |