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

Trong cuốn sách này, chúng tôi kiểm tra ngôn ngữ lập trình khác nhau, Python, Java, Perl, PHP và C. Trong số các ngôn ngữ này. C / C + + là của xa khó khăn nhất. Với các ngôn ngữ khác, mối quan tâm chính của bạn là xây dựng các SQL, việc thông qua rằng SQL để gọi chức năng, và thao tác các dữ liệu kết quả. C cho biết thêm các vấn đề rất phức tạp của quản lý bộ nhớ vào trộn. | DRAFT 9 10 01 C API In this book we examine several different programming languages Python Java Perl PHP and C. Of these languages. C C is by far the most challenging. With the other languages your primary concern is the formulation of SQL the passing of that SQL to a function call and the manipulation of the resulting data. C adds the very complex issue of memory management into the mix. MySQL provides C libraries that enable the creation of MySQL database applications. MySQL derives its API very heavily from mSQL and older database server still used to back-end many Internet web sites. However due to it s extensive development MySQL is much more feature-rich than mSQL. In this chapter we will examine the details of the MySQL C API by building an object-oriented C API than can be used to interface C programs to a MySQL database server. The API Whether you are using C or C the MySQL API is the gateway into the database. How you use it however can be very different depending on whether you are using C or the object-oriented features of C . C database programming must be attacked in a linear fashion where you step through your application process to understand where the database calls are made and where clean up needs to occur. Object-oriented C on the other hand requires an OO interface into the API of your choice. The objects of that API can then take on some of the responsibility for database resource management. Table 13-1 shows the function calls of the MySQL C API. We will go into the details of how these functions are used later in the chapter. Right now you should just take a minute to see what is available to you. Naturally the reference section lists each of these methods with detailed prototype information return values and descriptions. Table 13-1. The C API for MySQL MySQL mysql_affected_rows mysql_close mysql_connect Copyright 2001 O Reilly Associates Inc. 1 DRAFT 9 10 01 mysql_create_db mysql_data_seek mysql_drop_db mysql_eof mysql_error .

TỪ KHÓA LIÊN QUAN