The PYTHON DB API (SPEC) framework can be written at once while accessing Mysql\ Oracle \sqlserver ... Different database servers, the confusion of the Unified interface program.
1. Connection access: Connection (motorway)
Create method: MYSQLDB.C conflict (parameter: Host address port port number user passwd DB name CharSet connection encoding)
Connection object Support methods:
Cursor used to create a return
Commit Commit
Rollback rollback
Close closes
2. Data interaction: Cursor (van)//3. Exception class: Exception (Accident) Try ... Exceptcursor object supported methods:
Execute executes database queries and commands; client <==> server
Fetchone get the next line of the result set
Fetchmany ... Next few lines;
Fetcall gets the remainder of the result set, so the line
RowCount last execute returns the number of rows of data or affects the number of rows
Close Cursor Object
3. Close Cursor Connectione
=======================================
Additions and deletions: Inser Update Delete operation database
Python access to the database