Database Reference
In-Depth Information
CHAPTER 2
Writing MySQL-Based Programs
2.0. Introduction
This chapter discusses how to use MySQL from within the context of a general-purpose
programming language. It covers basic application programming interface (API) op‐
erations that are fundamental to and form the basis for the programming recipes de‐
veloped in later chapters. These operations include connecting to the MySQL server,
executing statements, and retrieving the results.
MySQL-based client programs can be written using many languages. This topic covers
the languages and interfaces shown in the following table (for information on obtaining
the interface software, see the Preface ):
Language
Interface
Perl
Perl DBI
Ruby
Ruby DBI
PHP
PDO
Python
DB API
Java
JDBC
MySQL client APIs provide these capabilities, each covered in a section of this chapter:
Connecting to the MySQL server, selecting a database, and disconnecting from the
server
Every program that uses MySQL must first establish a connection to the server.
Most programs also select a default database, and well-behaved MySQL programs
close the connection to the server when they're done with it.
 
Search WWH ::




Custom Search