Before the PythonDB-API is available, the application interfaces of different databases are messy and their implementations are different. If the project needs to change the database, a lot of modifications are required, which is inconvenient. The
Python Connection database learning DB-API details, pythondb-api
Preface
Everyone knows that if you want to connect to a database in Python, whether it is MySQL, SQL Server, PostgreSQL, or SQLite, the cursor method is used, so you have to learn
Before the Python Db-api, the application interface between the databases was very confusing and the implementations were different. If the project needs to replace the database, you need to make a lot of changes, very inconvenient. The advent of
This article mainly introduces the python database client DB-API related information, need a friend can refer to the next
1. DB-API Overview
Python supports many different databases. The network protocol for communication with databases varies
I. Overview of DB-API
Python supports a number of different databases. Because different seller servers result in different network protocols for database communication. In earlier versions of Python, each database had its own Python module, all of
1. DB-API OverviewPython supports many different databases. The network protocol for communication with databases varies depending on the seller's server. In earlier versions of python, each database has its own python module. All these modules work
When we maintain the system, we need to send the alarm information of the system to the corresponding students, if the contact method is written directly into the script, the future maintenance changes will bury the curse, especially hundreds of
ThreadsafetyThread-safe level. Threadsafety This is an integer, the value range is as follows:
0: Thread-safe is not supported, multiple threads cannot share this module
1: Primary thread-safe support: threads can share modules but
Sql_server Adapter /Sql_server Adapter1 Environment Configuration /Environment ConfigurationInstalling the Sql_server Python Adapter packPip Install pymssql Note: The remote database server is used here, so the local sql_server is not installed2
MySQLdb actually a bit like PHP or ASP in a connection to the database mode, but MYSQLDB is for MySQL connection interface, we can connect mysqldb in Python to achieve various operations of the data.Python connects MySQL with Oursql, Pymysql,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.