Creating Database books in MySQL

For each MySQL database we discuss in this book, we provide a SQL script that will set up the database and its tables. These scripts can be executed with a command-line tool called mysql that is part of the MySQL installation. In the examples directory for this chapter on the CD that accompanies this book, you will find the SQL script books.sql.

To create the books database:

  1. Open a Command Prompt and change to the C:mysqlin directory. [Note: If you installed MySQL on a directory other than C:mysql, replace C:mysql with your MySQL installation directory.]
  2. Start the database server by executing the command

    C:mysqlin>mysqld
    
  3. Copy the SQL script books.sql to the C:mysqlin directory. [Note: If you installed MySQL on a directory other than C:mysql, replace C:mysql with your MySQL installation directory.]
  4. Open a new Command Prompt and change to the C:mysqlin directory. [Note: If you installed MySQL on a directory other than C:mysql, replace C:mysql with your MySQL installation directory.]
  5. Create the books database by executing the command
C:mysqlin>mysql -h localhost -u jhtp6 -p < books.sql

When the above command is executed, you are prompted for entering the password, which is jhtp6. After completing this task, a new directory named books will be created in the C:mysqldata directory. This new directory contains the books database. You are now ready to proceed to the first JDBC example.


Introduction to Computers, the Internet and the World Wide Web

Introduction to Java Applications

Introduction to Classes and Objects

Control Statements: Part I

Control Statements: Part 2

Methods: A Deeper Look

Arrays

Classes and Objects: A Deeper Look

Object-Oriented Programming: Inheritance

Object-Oriented Programming: Polymorphism

GUI Components: Part 1

Graphics and Java 2D™

Exception Handling

Files and Streams

Recursion

Searching and Sorting

Data Structures

Generics

Collections

Introduction to Java Applets

Multimedia: Applets and Applications

GUI Components: Part 2

Multithreading

Networking

Accessing Databases with JDBC

Servlets

JavaServer Pages (JSP)

Formatted Output

Strings, Characters and Regular Expressions

Appendix A. Operator Precedence Chart

Appendix B. ASCII Character Set

Appendix C. Keywords and Reserved Words

Appendix D. Primitive Types

Appendix E. (On CD) Number Systems

Appendix F. (On CD) Unicode®

Appendix G. Using the Java API Documentation

Appendix H. (On CD) Creating Documentation with javadoc

Appendix I. (On CD) Bit Manipulation

Appendix J. (On CD) ATM Case Study Code

Appendix K. (On CD) Labeled break and continue Statements

Appendix L. (On CD) UML 2: Additional Diagram Types

Appendix M. (On CD) Design Patterns

Appendix N. Using the Debugger

Inside Back Cover



Java(c) How to Program
Java How to Program (6th Edition) (How to Program (Deitel))
ISBN: 0131483986
EAN: 2147483647
Year: 2003
Pages: 615

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net