-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkb.py
More file actions
28 lines (25 loc) · 995 Bytes
/
kb.py
File metadata and controls
28 lines (25 loc) · 995 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
# import pyodbc
# conn = pyodbc.connect('DRIVER={KingbaseES 7 ODBC Driver};SERVER=127.0.0.1;port=54321;DATABASE=CINA_MBGZ;UID=system;PWD=cinasoft')
# cursor = conn.cursor()
# #cursor.execute( "update mbxt set name='pdw' where id=3" )
# cursor.execute( "select * from mbxt" )
# ertu = cursor.fetchall()
# print(ertu[0])
import ksycopg2
conn = ksycopg2.connect(database="CINA_MBGZ", user="SYSTEM", password="cinasoft", host="127.0.0.1", port="54321")
if conn:
print('chenggong!!!')
# cur = conn.cursor()
# cur.execute("select * from mbxt")
# row = cur.fetchone()
# while row:
# print("ID = ", row[0])
# print("NAME = ", row[1], "\n")
# row = cur.fetchone()
# conn.close()
# import psycopg2
# conn = psycopg2.connect( database="CINA_MBGZ", user="system", password="cinasoft", host="127.0.0.1", port="54321" )
# cursor = conn.cursor()
# cursor.execute( "select * from mbxt" )
# ertu = cursor.fetchone() #cursor.fetchall()
# print(ertu)