-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDBUtil.py
More file actions
37 lines (27 loc) · 795 Bytes
/
Copy pathDBUtil.py
File metadata and controls
37 lines (27 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'''
Created on Feb 11, 2016
@author: sumkuma2
'''
import MySQLdb
class DbUtil:
'''
This calss provide a DB connection handler for MySQLDB
'''
def __init__(self):
'''
Constructor
'''
def getMySQLConnection(self):
'''
This method has been implemented to connect with MySQLDB and prepare a connection handler for DB operations.
'''
dbhost='localhost'
dbname='pythondb'
dbuser='root'
dbpwd='root'
#dbhost = self.dbhost
#dbname = self.dbname
#dbuser = self.dbuser
#dbpwd = self.dbpwd
con = MySQLdb.connect(dbhost,dbuser,dbpwd,dbname);
return con