Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: Insert records into MySQL database

import MySQLdb 
myBD = MySQLdb.connect(host="127.0.0.1", 
                       port=3306,user='myusernae',passwd='12345', db="Sales"))
bd_cursor

Python: How to Connect to MySQL Server

import MySQLdb           
myBD = MySQLdb.connect(host="127.0.0.1", 
                       port=3306,user='username',passwd='12345')
bd_cursor = my

Python: How to connect to SQLite Datebase using SQLAlchemy

import sqlalchemy
engine = sqlalchemy.create_engine('sqlite:///Employee.db')
# Execute a query
for res in engine.execute('SELECT * FROM Clients'):

Python: SHOW DATABASES

import MySQLdb           
myBD = MySQLdb.connect(host="127.0.0.1", 
                       port=3306,user='username',passwd='12345')
db_cursor = my

Python: Select rows from a table

import MySQLdb
db= MySQLdb.connect(host="localhost",
    user="myusername", passwd="mypassword", db="Sales")
bd_cursor = db.cursor()
req = "SELECT

Python: How to insert records into SQL Server Database

import MSSQL  
myBD = MSSQL.connect(host="127.0.0.1", 
port=3306,user='sakoba',passwd='12345', db="Sales")
bd_cursor = myBD.cursor()
pers={'FullNam

Python: Execute a Query on SQL Server Database

import MSSQL        
myBD = MSSQL.connect(host="127.0.0.1", 
port=3306,user='sakoba',passwd='12345', db="Sales")
bd_cursor = myBD.cursor()
# Execut

Python: How to connect to Oracle Database

from dcoracle import connect
db_conn = connect("user/mot_de_passe@system")
bd_cursor = db_conn.cursor(  )
occupation, age = 'WebDesigner', 22
# Exe