亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qsqldatabase.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtSql module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qsqldatabase.h"#include "qsqlquery.h"#ifdef Q_OS_WIN32// Conflicting declarations of LPCBYTE in sqlfront.h and winscard.h#define _WINSCARD_H_#endif#ifdef QT_SQL_PSQL#include "../drivers/psql/qsql_psql.h"#endif#ifdef QT_SQL_MYSQL#include "../drivers/mysql/qsql_mysql.h"#endif#ifdef QT_SQL_ODBC#include "../drivers/odbc/qsql_odbc.h"#endif#ifdef QT_SQL_OCI#include "../drivers/oci/qsql_oci.h"#endif#ifdef QT_SQL_TDS#include "../drivers/tds/qsql_tds.h"#endif#ifdef QT_SQL_DB2#include "../drivers/db2/qsql_db2.h"#endif#ifdef QT_SQL_SQLITE#include "../drivers/sqlite/qsql_sqlite.h"#endif#ifdef QT_SQL_SQLITE2#include "../drivers/sqlite2/qsql_sqlite2.h"#endif#ifdef QT_SQL_IBASE#include "../drivers/ibase/qsql_ibase.h"#endif#include "qdebug.h"#include "qcoreapplication.h"#include "qreadwritelock.h"#include "qsqlresult.h"#include "qsqldriver.h"#include "qsqldriverplugin.h"#include "qsqlindex.h"#include "private/qfactoryloader_p.h"#include "private/qsqlnulldriver_p.h"#include "qmutex.h"#include "qhash.h"#include <stdlib.h>#ifndef QT_NO_LIBRARYQ_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,                          (QSqlDriverFactoryInterface_iid,                           QCoreApplication::libraryPaths(),                           QLatin1String("/sqldrivers")))#endifQT_STATIC_CONST_IMPL char *QSqlDatabase::defaultConnection = "qt_sql_default_connection";typedef QHash<QString, QSqlDriverCreatorBase*> DriverDict;class QConnectionDict: public QHash<QString, QSqlDatabase>{public:    inline bool contains_ts(const QString &key)    {        QReadLocker locker(&lock);        return contains(key);    }    inline QStringList keys_ts() const    {        QReadLocker locker(&lock);        return keys();    }    mutable QReadWriteLock lock;};class QSqlDatabasePrivate{public:    QSqlDatabasePrivate(QSqlDriver *dr = 0):        driver(dr),        port(-1)    {        ref = 1;    }    QSqlDatabasePrivate(const QSqlDatabasePrivate &other);    ~QSqlDatabasePrivate();    void init(const QString& type);    void copy(const QSqlDatabasePrivate *other);    void disable();    QAtomic ref;    QSqlDriver* driver;    QString dbname;    QString uname;    QString pword;    QString hname;    QString drvName;    int port;    QString connOptions;    static QSqlDatabasePrivate *shared_null();    static QSqlDatabase database(const QString& name, bool open);    static void addDatabase(const QSqlDatabase &db, const QString & name);    static void removeDatabase(const QString& name);    static void invalidateDb(const QSqlDatabase &db, const QString &name);    static DriverDict &driverDict();    Q_GLOBAL_STATIC(QConnectionDict, dbDict)    static void cleanConnections();};QSqlDatabasePrivate::QSqlDatabasePrivate(const QSqlDatabasePrivate &other){    ref = 1;    dbname = other.dbname;    uname = other.uname;    pword = other.pword;    hname = other.hname;    drvName = other.drvName;    port = other.port;    connOptions = other.connOptions;    driver = other.driver;}QSqlDatabasePrivate::~QSqlDatabasePrivate(){    if (driver != shared_null()->driver)        delete driver;}void QSqlDatabasePrivate::cleanConnections(){    QConnectionDict *dict = dbDict();    Q_ASSERT(dict);    QWriteLocker locker(&dict->lock);    QConnectionDict::iterator it = dict->begin();    while (it != dict->end()) {        invalidateDb(it.value(), it.key());        ++it;    }    dict->clear();}static bool qDriverDictInit = false;static void cleanDriverDict(){    qDeleteAll(QSqlDatabasePrivate::driverDict());    QSqlDatabasePrivate::driverDict().clear();    QSqlDatabasePrivate::cleanConnections();    qDriverDictInit = false;}DriverDict &QSqlDatabasePrivate::driverDict(){    static DriverDict dict;    if (!qDriverDictInit) {        qDriverDictInit = true;        qAddPostRoutine(cleanDriverDict);    }    return dict;}QSqlDatabasePrivate *QSqlDatabasePrivate::shared_null(){    static QSqlNullDriver dr;    static QSqlDatabasePrivate n(&dr);    return &n;}void QSqlDatabasePrivate::invalidateDb(const QSqlDatabase &db, const QString &name){    if (db.d->ref != 1) {        qWarning("QSqlDatabasePrivate::removeDatabase: connection '%s' is still in use, "                 "all queries will cease to work.", name.toLocal8Bit().constData());        db.d->disable();    }}void QSqlDatabasePrivate::removeDatabase(const QString &name){    QConnectionDict *dict = dbDict();    Q_ASSERT(dict);    QWriteLocker locker(&dict->lock);    if (!dict->contains(name))        return;    invalidateDb(dict->take(name), name);}void QSqlDatabasePrivate::addDatabase(const QSqlDatabase &db, const QString &name){    QConnectionDict *dict = dbDict();    Q_ASSERT(dict);    QWriteLocker locker(&dict->lock);    if (dict->contains(name)) {        invalidateDb(dict->take(name), name);        qWarning("QSqlDatabasePrivate::addDatabase: duplicate connection name '%s', old "                 "connection removed.", name.toLocal8Bit().data());    }    dict->insert(name, db);}/*! \internal*/QSqlDatabase QSqlDatabasePrivate::database(const QString& name, bool open){    const QConnectionDict *dict = dbDict();    Q_ASSERT(dict);    dict->lock.lockForRead();    QSqlDatabase db = dict->value(name);    dict->lock.unlock();    if (db.isValid() && !db.isOpen() && open) {        db.open();        if (!db.isOpen())            qWarning("QSqlDatabasePrivate::database: unable to open database: %s",                     db.lastError().text().toLocal8Bit().data());    }    return db;}/*! \internal    Copies the connection data from \a other.*/void QSqlDatabasePrivate::copy(const QSqlDatabasePrivate *other){    dbname = other->dbname;    uname = other->uname;    pword = other->pword;    hname = other->hname;    drvName = other->drvName;    port = other->port;    connOptions = other->connOptions;}void QSqlDatabasePrivate::disable(){    if (driver != shared_null()->driver) {        delete driver;        driver = shared_null()->driver;    }}/*!    \class QSqlDriverCreatorBase    \brief The QSqlDriverCreatorBase class is the base class for    SQL driver factories.    \ingroup database    \module sql    Reimplement createObject() to return an instance of the specific    QSqlDriver subclass that you want to provide.    See QSqlDatabase::registerSqlDriver() for details.    \sa QSqlDriverCreator*//*!    \fn QSqlDriverCreatorBase::~QSqlDriverCreatorBase()    Destroys the SQL driver creator object.*//*!    \fn QSqlDriver *QSqlDriverCreatorBase::createObject() const    Reimplement this function to returns a new instance of a    QSqlDriver subclass.*//*!    \class QSqlDriverCreator    \brief The QSqlDriverCreator class is a template class that    provides a SQL driver factory for a specific driver type.    \ingroup database    \module sql    QSqlDriverCreator<T> instantiates objects of type T, where T is a    QSqlDriver subclass.    See QSqlDatabase::registerSqlDriver() for details.*//*!    \fn QSqlDriver *QSqlDriverCreator::createObject() const    \reimp*//*!    \class QSqlDatabase    \brief The QSqlDatabase class represents a connection to    a database.    \ingroup database    \mainclass    \module sql    The QSqlDatabase class provides an abstract interface for    accessing database backends. It relies on database-specific    \l{QSqlDriver}s to actually access and manipulate data.    The following code shows how to initialize a connection:    \quotefromfile snippets/sqldatabase/sqldatabase.cpp    \skipto QSqlDatabase_snippet    \skipto QSqlDatabase db =    \printuntil db.open()    Once a QSqlDatabase object has been created you can set the    connection parameters with setDatabaseName(), setUserName(),    setPassword(), setHostName(), setPort(), and setConnectOptions().    Once the parameters have been set up you can call open() to open    the connection.    The connection defined above is a nameless connection. If is the    default connection and can be accessed using database() later on:    \skipto QSqlDatabase db =    \printline QSqlDatabase db =    To make programming more convenient, QSqlDatabase is a value    class. Any changes done to a database connection through one    QSqlDatabase object will affect other QSqlDatabase objects    representing the same connection. Call cloneDatabase() if you want    to create an independent database connection based on an existing    one.    If you need multiple database connections simultaneously, specify    an arbitrary name to addDatabase() and database(). Call    removeDatabase() to remove connections. QSqlDatabase will output    a warning if you try to remove a connection referenced by other    QSqlDatabase objects. Use contains() to see if a given connection    name is in the list of connections.    Once a connection is established you can see what tables the    database offers with tables(), find the primary index for a table    with primaryIndex(), get meta-information about a table's fields    (e.g., their names) with record(), and execute a query with exec().    If transactions are supported, you can use transaction() to start    a transaction, and then commit() or rollback() to complete it.    You can find out whether transactions are supported using    QSqlDriver::hasFeature().    If an error occurred, it is given by lastError().    The names of the underlying SQL drivers are available from    drivers(); you can check for a particular driver with    isDriverAvailable(). If you have created your own custom driver,    you can register it with registerSqlDriver().    \sa QSqlDriver, QSqlQuery, {QtSql Module}*//*!    \threadsafe    Adds a database to the list of database connections using the    driver \a type and the connection name \a connectionName. If    there already exists a database connection called \a    connectionName, that connection is removed.    The database connection is referred to by \a connectionName. The    newly added database connection is returned.    If \a connectionName is not specified, the newly added database    connection becomes the default database connection for the    application, and subsequent calls to database() without a    database name parameter will return a reference to it. If \a    connectionName is given, use database(\a connectionName) to    retrieve a pointer to the database connection.    \warning If you add a database with the same name as an    existing database, the new database will replace the old one.    This will happen automatically if you call this function more    than once without specifying \a connectionName.    To make use of the connection, you will need to set it up, for    example by calling some or all of setDatabaseName(),    setUserName(), setPassword(), setHostName(), setPort(), and    setConnectOptions(), and then you'll need to open() the    connection.    \sa database() removeDatabase()*/QSqlDatabase QSqlDatabase::addDatabase(const QString &type, const QString &connectionName){    QSqlDatabase db(type);    QSqlDatabasePrivate::addDatabase(db, connectionName);    return db;}/*!    \threadsafe    Returns the database connection called \a connectionName. The    database connection must have been previously added with    addDatabase(). If \a open is true (the default) and the database    connection is not already open it is opened now. If no \a    connectionName is specified the default connection is used. If \a    connectionName does not exist in the list of databases, an invalid    connection is returned.    \sa isOpen()*/QSqlDatabase QSqlDatabase::database(const QString& connectionName, bool open){    return QSqlDatabasePrivate::database(connectionName, open);}/*!    \threadsafe    Removes the database connection \a connectionName from the list of    database connections.    \warning There should be no open queries on the database    connection when this function is called, otherwise a resource leak    will occur.    Example:    \code    // WRONG    QSqlDatabase db = QSqlDatabase::database("sales");    QSqlQuery query("SELECT NAME, DOB FROM EMPLOYEES", db);    QSqlDatabase::removeDatabase("sales"); // will output a warning    // "db" is now a dangling invalid database connection,    // "query" contains an invalid result set    \endcode    The correct way to do it:    \code    {        QSqlDatabase db = QSqlDatabase::database("sales");        QSqlQuery query("SELECT NAME, DOB FROM EMPLOYEES", db);    }    // Both "db" and "query" are destroyed because they are out of scope    QSqlDatabase::removeDatabase("sales"); // correct    \endcode    \sa database()*/void QSqlDatabase::removeDatabase(const QString& connectionName){    QSqlDatabasePrivate::removeDatabase(connectionName);}/*!    Returns a list of all the available database drivers.    \sa registerSqlDriver()*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产最新精品精品你懂的| 欧美精品第1页| 欧美日韩久久久久久| 久久久久久久综合色一本| 亚洲福利电影网| 成人视屏免费看| 精品欧美一区二区在线观看| 亚洲欧美激情插 | 亚洲国产精品高清| 久草中文综合在线| 欧美性猛交xxxxxx富婆| 国产精品国产a级| 国产精品一区在线| 精品久久一区二区三区| 日韩经典中文字幕一区| 欧美优质美女网站| 亚洲人成网站影音先锋播放| 成人av资源在线观看| 2023国产精品自拍| 九色综合狠狠综合久久| 在线综合视频播放| 午夜视频在线观看一区| 在线视频你懂得一区| 亚洲同性同志一二三专区| 高清不卡一二三区| 欧美国产乱子伦| 成人av综合一区| 国产精品久久久久永久免费观看| 国产一区二区三区精品视频| 欧美精品一区男女天堂| 激情欧美一区二区| 久久久久久久网| 国产麻豆一精品一av一免费| 精品第一国产综合精品aⅴ| 精品一区二区三区在线播放视频| 欧美一区二区视频在线观看2022| 日韩精品视频网站| 欧美成人福利视频| 经典三级视频一区| 国产欧美精品一区二区色综合| 国产福利一区二区| 中文在线一区二区| 欧洲精品在线观看| 天天影视涩香欲综合网| 日韩一级片在线播放| 国产在线视视频有精品| 国产日韩影视精品| 色婷婷av一区二区| 午夜影院在线观看欧美| 日韩一级精品视频在线观看| 国产在线日韩欧美| 国产精品高潮呻吟久久| 欧美日韩在线播放三区| 麻豆国产精品一区二区三区| 久久色视频免费观看| 99久久伊人久久99| 性欧美疯狂xxxxbbbb| 久久色中文字幕| 色综合视频在线观看| 青青青伊人色综合久久| 国产日韩欧美a| 欧美丝袜自拍制服另类| 久久99国产精品免费| 综合欧美一区二区三区| 91精品国产手机| 成人av网在线| 日韩专区中文字幕一区二区| 亚洲国产成人午夜在线一区| 欧美亚洲综合另类| 国产露脸91国语对白| 一二三四社区欧美黄| 欧美va亚洲va国产综合| 91麻豆.com| 激情欧美一区二区三区在线观看| 亚洲免费在线播放| 久久久久久久精| 欧美日免费三级在线| 国产99久久久久| 日韩二区在线观看| 成人免费在线视频| 久久久精品天堂| 91精品国产91久久综合桃花| 色综合中文字幕| 国产成人一区在线| 久久国产综合精品| 婷婷六月综合亚洲| 亚洲欧美日韩国产综合在线| 久久综合色之久久综合| 777欧美精品| 色婷婷综合久久| 国产成人在线色| 国产真实乱偷精品视频免| 日本成人中文字幕| 亚洲成av人片在线观看无码| 亚洲欧洲日韩av| 久久亚洲精华国产精华液 | 国产一区二区三区精品视频| 性做久久久久久| 亚洲一区二区在线视频| 国产精品国产三级国产普通话蜜臀| 欧美精品一区二区三区久久久| 欧美日韩国产高清一区二区三区| 色婷婷综合久久久中文一区二区| 成人丝袜18视频在线观看| 国产69精品一区二区亚洲孕妇| 久久99精品国产.久久久久| 日韩av高清在线观看| 日韩专区中文字幕一区二区| 日韩在线一区二区| 亚州成人在线电影| 日韩国产精品久久久久久亚洲| 亚洲国产日韩一区二区| 亚洲线精品一区二区三区| 亚洲在线免费播放| 亚洲午夜视频在线| 丝袜美腿亚洲色图| 日韩高清电影一区| 极品美女销魂一区二区三区 | 欧美日韩和欧美的一区二区| av爱爱亚洲一区| 成人精品亚洲人成在线| 国产ts人妖一区二区| 成人aa视频在线观看| 色综合欧美在线| 欧美性感一类影片在线播放| 欧美日韩三级视频| 91精品啪在线观看国产60岁| 欧美一区午夜精品| 久久精品亚洲乱码伦伦中文| 中文字幕欧美区| 亚洲精品乱码久久久久久久久 | 日韩精品最新网址| 久久精品无码一区二区三区| 国产精品蜜臀av| 亚洲乱码国产乱码精品精可以看| 亚洲国产裸拍裸体视频在线观看乱了| 日精品一区二区三区| 国产成人亚洲综合色影视| 一本色道久久综合精品竹菊 | 在线看国产一区二区| 欧美人动与zoxxxx乱| 欧美电影精品一区二区| 国产精品三级av在线播放| 亚洲精品国产a| 六月丁香综合在线视频| 99久久婷婷国产综合精品| 欧美男同性恋视频网站| 久久精品免费在线观看| 亚洲精品欧美综合四区| 久久电影网电视剧免费观看| 99re热这里只有精品视频| 91精品一区二区三区在线观看| 久久久久国产一区二区三区四区| 国产精品久久久久久久第一福利 | 亚洲欧洲一区二区在线播放| 日韩精品电影在线| 91在线观看美女| 日韩一区二区电影网| 亚洲另类春色国产| 国产一区久久久| 欧美日韩国产高清一区| 国产精品人成在线观看免费 | 亚洲午夜电影在线| 国产精品白丝av| 欧美一区二区视频免费观看| 亚洲色欲色欲www| 国产一区二区在线观看免费| 欧美系列亚洲系列| 国产精品国产三级国产有无不卡| 蜜桃一区二区三区四区| 欧美亚洲国产一卡| 亚洲欧洲无码一区二区三区| 久久99精品久久久久久| 69堂国产成人免费视频| 亚洲精品中文在线观看| eeuss鲁片一区二区三区| 久久亚区不卡日本| 卡一卡二国产精品 | 激情六月婷婷久久| 制服丝袜在线91| 亚洲五码中文字幕| 欧美在线一区二区| 亚洲欧美日韩在线| www.日本不卡| 欧美国产精品中文字幕| 国产乱码精品一区二区三区忘忧草| 欧美一区二区二区| 日韩电影在线一区| 91精品国产综合久久精品图片| 亚洲精品欧美二区三区中文字幕| 99久久精品国产精品久久| 中文在线一区二区| 国产999精品久久| 国产亚洲婷婷免费| 国产很黄免费观看久久| 国产偷国产偷亚洲高清人白洁| 国产在线一区观看| 欧美激情一区在线| 99久久综合国产精品| 亚洲四区在线观看|