To execute the example in our RowSets tutorial, you must install MySQL and the MySQL Connector/J, then create our books database. A script to help create the database is located in the example download for this article.
[Notes: This is an excerpt (Section 25.5) of Chapter 25, Accessing Databases with JDBC, from our best-selling textbook Java How to Program, 6/e. This tutorial may refer to other chapters or sections of the book that are not included here. When you purchase this book you also get free access to the Web-based Java Multimedia Cyber Classroom, 6/e, for six months. The Cyber Classroom includes audio descriptions of the examples in Chapters 1-14, solutions to approximately one-half of the end-of-chapter exercises, interactive true/false self-assessment questions and a searchable Web-based e-book. Permission Information: Deitel, Harvey M. and Paul J., JAVA HOW TO PROGRAM, ©2005, p. 1206. Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey.]
Java RowSet Tutorial, Setup Part 1: Instructions to install MySQL and MySQL Connector/J
The CD that accompanies Java How to Program, 6/e includes MySQL 4.0.20—an open-source database management system. MySQL executes on many platforms, including Windows, Solaris, Linux, and Macintosh. Complete information about MySQL is available from To install MySQL:1. Download MySQL from www.mysql.com. We used the 4.0. The most recent build of 4.0 that is available can be found at: http://dev.mysql.com/downloads/mysql/4.0.html.
2. After downloading the installer, execute it and follow the instructions to install MySQL in the C:\mysql directory, which is the default directory.
To use MySQL with JDBC, you also need to install MySQL Connector/J—a JDBC driver that allows programs to access MySQL databases via JDBC. MySQL Connector/J is on the CD that accompanies this book and can also be downloaded from
At the time of this writing, the current stable release of MySQL Connector/J was 3.0.14. To install MySQL Connector/J:1. Copy mysql-connector-java-3.0.14-production.zip to your hard disk.
2. Open mysql-connector-java-3.0.14-production.zip with a file extractor, such as WinZip, which can be downloaded from www.winzip.com. Extract its content to the C:\ drive to create a directory named mysql-connector-java-3.0.14-production. The documentation for MySQL Connector/J is in connector-j-en.pdf in the docs subdirectory of mysql-connector-java-3.0.14-production, or you can view it online at dev.mysql.com/doc/connector/j/en/index.html.
Setup for RowSets Example:
Java RowSet Tutorial, Setup Part 1: Instructions to install MySQL and MySQL Connector/J (You are here)
Java RowSet Tutorial, Setup Part 2: Instructions on Setting MySQL User Account
Java RowSet Tutorial, Setup Part 3: Creating Database books in MySQL

