diff --git a/cve-py/dbConnecttion/Config.py b/cve-py/dbConnecttion/Config.py index 94943992b865d1c3ea4aeb41692da6fac752c801..dca181d5478da2c3243fda160c4bd5f1c9fa427a 100644 --- a/cve-py/dbConnecttion/Config.py +++ b/cve-py/dbConnecttion/Config.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # -*- coding: UTF-8 -*- ################################################################################ diff --git a/cve-py/dbConnecttion/MysqlConn.py b/cve-py/dbConnecttion/MysqlConn.py index b346c49519a1b64408c261d4084a26e15aa7fe2b..b1c4032ef7f95ed313e738050b5fc5b79595eee3 100644 --- a/cve-py/dbConnecttion/MysqlConn.py +++ b/cve-py/dbConnecttion/MysqlConn.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # -*- coding: UTF-8 -*- ################################################################################ @@ -21,7 +21,7 @@ Date: 10/22/2020 11:01 AM import pymysql from pymysql import cursors from DBUtils import PooledDB -from dbConnecttion import config +from dbConnecttion import Config class Mysql(object): @@ -45,11 +45,11 @@ class Mysql(object): """ if Mysql.__pool is None: __pool = PooledDB.PooledDB(creator=pymysql, mincached=1, - maxcached=20, host=config.DBHOST, - port=config.DBPORT, - user=config.DBUSER, - passwd=config.DBPWD, db=config.DBNAME, - use_unicode="UTF-8", charset=config.DBCHAR, + maxcached=20, host=Config.DBHOST, + port=Config.DBPORT, + user=Config.DBUSER, + passwd=Config.DBPWD, db=Config.DBNAME, + use_unicode="UTF-8", charset=Config.DBCHAR, cursorclass=cursors.DictCursor) return __pool.connection() return None diff --git a/cve-py/dbConnecttion/__init__.py b/cve-py/dbConnecttion/__init__.py index c2f881e8e5844761b00073ec27a30788eabad040..96c381b2818a9184954ed24ece68565b35eec741 100644 --- a/cve-py/dbConnecttion/__init__.py +++ b/cve-py/dbConnecttion/__init__.py @@ -1,8 +1,3 @@ """ -Created on October 15, 2020 - -@author: xjh -1. When executing SQL with parameters, please use sql statement to specify the list of conditions that need to be entered, and then use tuple/list for conditional batch allocation -2. There is no need to use quotation marks to specify the data type in the format SQL, and the system will automatically recognize it according to the input parameters -3. There is no need to use conversion function in the input value, the system will automatically handle it + connect mysql """ \ No newline at end of file