📜  db 连接字符串超时 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:59.869000             🧑  作者: Mango

代码示例1
result = None
with pyodbc.connect('DRIVER={SQL Server};SERVER=mydb;DATABASE=solarwinds;Trusted_Connection=True', timeout=1) as cnxn:
    cursor = cnxn.cursor()
    result = cursor.execute(query).fetchall()