tailieunhanh - Hướng dẫn sử dụng MySQL part 22

Tóm tắt Xác định các loại giữ chỗ tham số trong các truy vấn tham số. DB-API hỗ trợ nhiều giá trị giá trị cho thuộc tính này, nhưng thực tế chỉ hỗ trợ MySQLdb "định dạng" và "pyformat". Thuộc tính này phần lớn là vô nghĩa để phát triển MySQL | __DRAFT 8 24 01 25 The Python DB-API DB-API is a single API for supporting database-independent database access. The MySQL implementation of this API MySQLdb can be downloaded from http andy python MySQLdb. It comes with a Redhat RPM Linux installer a Win32 installer and a Python script for other platforms. For the other platforms 1. Uncompress the . file that contains MySQLdb using the commands gunzip and tar xf . 2. Change directories into the newly generated MySQLdb directory. 3. Issue the command python install The MySQLdb module contains both the standard DB-API methods and attributes as well as several proprietary methods and attributes. Proprietary APIs are marked with asterisks. Module MySQLdb The entry point into the MySQL module is via the method. The return value from this method represents a connection to a MySQL database that you can use for all of your MySQL operations. Module Attributes Attribute apilevel Synopsis A string constant storing the version of the DB-API that MySQLdb supports. Copyright 2001 O Reilly Associates Inc. 451 DRAFT 8 24 01 Attribute paramstyle Synopsis Defines the type of parameter placeholder in parameterized queries. DB-API supports many valid values for this attribute but MySQLdb actually supports only format and pyformat . This attribute is largely meaningless to MySQL developers. Attribute quote conv Synopsis Maps Python types to MySQL literals via a dictionary mapping. Attribute threadsafety Synopsis Specifies the level of thread-safety supported by MySQLdb. Possible values are 0 - Threads may no share the module 1 - Threads may share the module but not the connections 2 - Threads may share the module and connections 3 - Threads may share the module connections and cursors Attribute type conv Synopsis Maps MySQL types from strings to the desired mapping type using. This value is initialized with the following values int .

TỪ KHÓA LIÊN QUAN