20.7 HOMEWORK


20.7 HOMEWORK

  1. Write a JDBC program that can serve as a front-end server to a MySQL database. Your JDBC server should perform the following tasks:

    1. Establish a password-protected connection between a client and the database. The client must specify his/her username, password, and the database name.

    2. Report back any error messages to the client if there is any error while connecting with the MySQL database and allow the client to try to reconnect repeatedly until the client enters "exit" as the username.

    3. Execute each SQL statement received from the client and display the retrieved results to the client as necessary.

    4. Display on the client's terminal an error message if the SQL command is invalid.

    5. Continue receiving SQL statements from a client until "exit" is entered by the user.

    [Suggestion: The Java implementation of the chat server program of Chapter 19 would be a good starting point for the program needed here.]

  2. Write a C++ implementation for the previous problem using Mysql++ classes. [Suggestion: As with the previous problem, the C++ implementation of the chat server program of Chapter 19 would be a good starting point for the solution needed here.]




Programming With Objects[c] A Comparative Presentation of Object-Oriented Programming With C++ and Java
Programming with Objects: A Comparative Presentation of Object Oriented Programming with C++ and Java
ISBN: 0471268526
EAN: 2147483647
Year: 2005
Pages: 273
Authors: Avinash Kak

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