Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

SQL Programming

This overview assumes that you have at least a basic knowledge of SQL. You should be able to understand simple SELECT, INSERT, UPDATE, and DELETE statements. Although the QSqlTableModel class provides an interface to database browsing and editing that does not require a knowledge of SQL, a basic understanding of SQL is highly recommended. A standard text covering SQL databases is An Introduction to Database Systems (7th Ed.) by C. J. Date, ISBN 0201385902.

Topics:

Database Classes

These classes provide access to SQL databases.

QSql

Contains miscellaneous identifiers used throughout the Qt SQL library

QSqlDatabase

Represents a connection to a database

QSqlDriver

Abstract base class for accessing specific SQL databases

QSqlDriverCreator

Template class that provides a SQL driver factory for a specific driver type

QSqlDriverCreatorBase

The base class for SQL driver factories

QSqlError

SQL database error information

QSqlField

Manipulates the fields in SQL database tables and views

QSqlIndex

Functions to manipulate and describe database indexes

QSqlQuery

Means of executing and manipulating SQL statements

QSqlQueryModel

Read-only data model for SQL result sets

QSqlRecord

Encapsulates a database record

QSqlRelationalTableModel

Editable data model for a single database table, with foreign key support

QSqlResult

Abstract interface for accessing data from specific SQL databases

QSqlTableModel

Editable data model for a single database table

The SQL classes are divided into three layers:

Driver Layer

This comprises the classes QSqlDriver, QSqlDriverCreator<T>, QSqlDriverCreatorBase, QSqlDriverPlugin, and QSqlResult.

This layer provides the low-level bridge between the specific databases and the SQL API layer. See SQL Database Drivers for more information.

SQL API Layer

These classes provide access to databases. Connections are made using the QSqlDatabase class. Database interaction is achieved by using the QSqlQuery class. In addition to QSqlDatabase and QSqlQuery, the SQL API layer is supported by QSqlError, QSqlField, QSqlIndex, and QSqlRecord.

User Interface Layer

These classes link the data from a database to data-aware widgets. They include QSqlQueryModel, QSqlTableModel, and QSqlRelationalTableModel. These classes are designed to work with Qt's model/view framework.

Note that to use any of these classes, a QCoreApplication object must have been instantiated first.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web