45 #include <QtCore/qobject.h> 46 #include <QtCore/qstring.h> 47 #include <QtCore/qstringlist.h> 48 #include <QtSql/qsql.h> 50 #include <QtSql/qsqlquery.h> 78 EventNotifications, FinishQuery, MultipleResultSets };
87 virtual bool isOpen()
const;
90 virtual bool beginTransaction();
91 virtual bool commitTransaction();
92 virtual bool rollbackTransaction();
100 {
return record(tablename); }
102 {
return query.
record(); }
104 inline QT3_SUPPORT
QString formatValue(
const QSqlField *field,
bool trimStrings =
false)
const 105 {
return field ? formatValue(*field, trimStrings) :
QString(); }
107 virtual QString formatValue(
const QSqlField& field,
bool trimStrings =
false)
const;
111 const QSqlRecord &rec,
bool preparedStatement)
const;
117 virtual void close() = 0;
127 bool unsubscribeFromNotification(
const QString &name);
137 void notification(
const QString &name);
140 virtual void setOpen(
bool o);
141 virtual void setOpenError(
bool e);
142 virtual void setLastError(
const QSqlError& e);
145 bool subscribeToNotificationImplementation(
const QString &name);
146 bool unsubscribeFromNotificationImplementation(
const QString &name);
147 QStringList subscribedToNotificationsImplementation()
const;
160 #endif // QSQLDRIVER_H The QVariant class acts like a union for the most common Qt data types.
The QSqlError class provides SQL database error information.
The QSqlIndex class provides functions to manipulate and describe database indexes.
void close()
Closes the database connection, freeing any resources acquired, and invalidating any existing QSqlQue...
bool isOpen() const
Returns true if the database connection is currently open; otherwise returns false.
#define QT_END_NAMESPACE
This macro expands to.
DriverFeature
This enum contains a list of features a driver might support.
QSqlRecord record() const
Returns a QSqlRecord containing the field information for the current query.
StatementType
This enum contains a list of SQL statement (or clause) types the driver can create.
The QSqlQuery class provides a means of executing and manipulating SQL statements.
The QSqlDatabase class represents a connection to a database.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
The QSqlRecord class encapsulates a database record.
The QSqlDriver class is an abstract base class for accessing specific SQL databases.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
QSqlIndex primaryIndex(const QString &tablename) const
Returns the primary index for table tablename.
int port() const
Returns the connection's port number.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QSqlRecord record(const QString &tablename) const
Returns a QSqlRecord populated with the names of all the fields in the table (or view) called tablena...
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const
Returns the current default precision policy for the database connection.
QSqlError lastError() const
Returns information about the last error that occurred on the database.
The QStringList class provides a list of strings.
QString password() const
Returns the connection's password.
bool isOpenError() const
Returns true if there was an error opening the database connection; otherwise returns false...
#define Q_DECLARE_PRIVATE(Class)
The QSqlField class manipulates the fields in SQL database tables and views.
The QSqlResult class provides an abstract interface for accessing data from specific SQL databases...
QStringList tables(QSql::TableType type=QSql::Tables) const
Returns a list of the database's tables, system tables and views, as specified by the parameter type...
IdentifierType
This enum contains a list of SQL identifier types.
int open(const char *, int,...)
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)
Sets the default numerical precision policy used by queries created on this database connection to pr...