Beispiel #1
0
def getConn(DB):
    global DSN
    if DSN is None:
        DSN = dbi.read_cnf()
    conn = dbi.connect(DSN)
    conn.select_db(DB)
    return conn
Beispiel #2
0
def getConn(db):
    # this line is to allow db connection on a personal account
    # dsn = dbi.read_cnf("~/.textbook.cnf")
    dsn = dbi.read_cnf()
    conn = dbi.connect(dsn)
    dbi.select_db(conn, db)
    return conn
Beispiel #3
0
def getConn(db):
    '''returns a database connection to the given database'''
    global DSN
    if DSN is None:
        DSN = dbi.read_cnf()
    conn = dbi.connect(DSN)
    conn.select_db(db)
    return conn
Beispiel #4
0
def getConn(db):
    '''Returns a database connection for that db'''
    dsn = dbi.read_cnf()
    conn = dbi.connect(dsn)
    conn.select_db(db)
    return conn
Beispiel #5
0
def getConn():
    '''Return connection to bluemark_db'''
    dsn = dbi.read_cnf('~/cs304/BlueMarket/static/bluemarket_db.cnf')
    conn = dbi.connect(dsn)
    conn.select_db('bluemark_db')
    return conn
Beispiel #6
0
def getConn(db):
    # dsn = dbi. read_cnf("~/.textbook.cnf")
    dsn = dbi.read_cnf()
    conn = dbi.connect(dsn)
    dbi.select_db(conn, db)
    return conn