In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Coding: utf-8 function description: data manipulation supplement date 20190527
Import pymssql
Import pymysql
Import time
From SQL import SQL
From Server_Info import DB_Info
Class Operate_DB (object):
"" docstring for Operate_DB "
Def init (self, DB_Info):
If DB_Info ['Type'] = =' pymssql':
Self.conn=pymssql.connect (host=DB_Info ['HostName'], database=DB_Info [' Database'], user=DB_Info ['User'], password=DB_Info [' Password'])
Elif DB_Info ['Type'] = =' pymysql':
Self.conn=pymysql.connect (host=DB_Info ['HostName'], database=DB_Info [' Database'], user=DB_Info ['User'], password=DB_Info [' Password'])
Else:
Print ('error')
Def O_DB (self,SQL,Action,*args): if Action=='serach': # self.conn.cursor.execute (SQL) yield self.conn.cursor.fetchall () elif Action==' Insert': self.conn.cursor () .execute (SQL) else: print (error) def close_DB (self): self.conn.commit () self.conn.close
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.