Thursday, 28 April 2016

Python Database Access Tutorial

Python database API provides number of modules to perform CRUD operations on databases. Python database API supports number of databases.

Python supports following RDBMS
IBM DB2
Firebird (and Interbase)
Informix
Ingres
MySQL
Oracle
PostgreSQL
SAP DB (also known as "MaxDB")
Microsoft SQL Server
Microsoft Access
Sybase

Python supports following Graph databases
Neo4j

Python supports following data warehouse systems
Teradata
IBM Netezza

Python supports following Embedded databases
asql
GadFly
SQLite
ThinkSQL

Python supports following Record oriented databases
MetaKit
ZODB
BerkeleyDB
KirbyBase
Durus
atop
buzhug

You must download a separate DB API module for each database you need to access. For example, suppose if you want to work with MySQL, you need to download MySQL database module, if you want to work with DB2, you need to download DB2 module and install. In this tutorial series, I am going to use MySQL. Next post explains you how to install MySQL module.


      Install MySQLdb on MAC OS
      MySQLdb: Hello World Application
      Create database table
      Insert records into table
      Update records
      Delete records
      Transaction support
      commit () : Commit the transactions
      rollback (): perform rollback
      Cursor object
      Reading data
      fetchone(): Fetch next row
      fetchmany: Fetch many records
      fetchall: Get all records that match to given query
      rowcount: Get number of rows affected/matched to given query
      fetchall: Get all records that match to given query
      rowcount: Get number of rows affected/matched to given query

References

Previous                                                 Next                                                 Home

No comments:

Post a Comment