Bulletproof web design - Chapter 17 . ODBC/JDBC 511 The JDBC interface

Chapter 17 . ODBC/JDBC 511 The JDBC interface JDBC for MySQL is a slight misnomer; Java database connectivity is, in fact, available for various RDBMS programs. In effect, JDBC functions like the Perl DBI it enables a range of database drivers to connect to various RDBMS products. For the purposes of this book, when I refer to the JDBC interface, I refer to a particular API the MySQL driver that works with the JDBC. The JDBC API itself is included with the core Java Software Development Kit (abbreviated as SDK or JDK I use JDK throughout this chapter). In particular, the java.sql package contains the classes needed for using MySQL to work with data. Where to get the JDBC and MySQL JDBC Driver The MySQL JDBC API is not an official MySQL AB product. However, the MySQL JDBC driver is linked from the MySQL AB Web site. I found the versions of the MySQL JDBC driver linked directly from MySQL AB s Web site to be relatively old. A newer version of the MySQL JDBC driver can usually be obtained directly from the following Web site: http://mmmysql.sourceforge.net/. The file format for the MySQL JDBC driver is a Java archive; you need the jar program to unpack it. You can obtain jarat the following Web site: http://mmmysql.sourceforge.net/ Getting the driver shouldn t be a problem; the Java Software Development Kit (JDK) is another a prerequisite to installing the JDBC MySQL driver. If you don t have the JDK, download it from the following Web site: http://java.sun.com/products/ Although I m hesitant to offer this link as the definitive Sun Java Web site (its location may change in the future), that s where you can download the latest JDK for Linux. Installing the MySQL JDBC Driver Before installing the MySQL JDBC driver, make sure you have the Java JDK installed. The JDK comes in a binary format, with a file extension of .bin. When you run the binary program, it creates a directory (below your current directory) and installs the Java JDK automatically. After you download the Java JDK, you may have to change the mode of the file before you can execute it. The command for doing so is as follows: chmod 700 j2sdk-.bin
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Leave a Reply