コード例 #1
0
    def connect( self, db_name, db_user, db_pass, db_address='127.0.0.1', db_port=3306):
        self.db_name  = db_name
        self.db_user = db_user
        self.db_pass = db_pass
        if db_port != 3306: 
            self.db_address = '%s:%s' %(db_address,db_port)
        else:
            self.db_address = db_address

        self.connection = database.connect(db = db_name, user = db_user, passwd = db_pass, host = db_address) #, port = db_port)
        self.connection.set_charset('utf8')
        self.connection.set_unicode(True)
コード例 #2
0
    def connect(self,
                db_name,
                db_user,
                db_pass,
                db_address='127.0.0.1',
                db_port=3306):
        self.db_name = db_name
        self.db_user = db_user
        self.db_pass = db_pass
        if db_port != 3306:
            self.db_address = '%s:%s' % (db_address, db_port)
        else:
            self.db_address = db_address

        self.connection = database.connect(db=db_name,
                                           user=db_user,
                                           passwd=db_pass,
                                           host=db_address)  #, port = db_port)
        self.connection.set_charset('utf8')
        self.connection.set_unicode(True)
コード例 #3
0
 def connect(self, db_name, *args):
     self.db_name = db_name
     self.connection = database.connect(db_name)
     self.connection.text_factory = unicode
コード例 #4
0
 def connect(self, db_name, *args):
     self.db_name = db_name
     self.connection = database.connect(db_name)
     self.connection.text_factory = unicode