Java Reference
In-Depth Information
If you are working with a database other than mySQL or Oracle, you
might want to check out http://servlet.java.sun.com/products/jdbc/
drivers for a list of approximately two hundred JDBC implementations for
various databases.
15.10
E XERCISES
1. Write a program that connects to a database and, for each of the tables
specified on the command line, prints out the table name and the number
of rows in that table.
2. Using what has been covered in this chapter, write a simple non-GUI SQL
program, allowing the user to enter SQL statements, executing them, and
showing the results (like a simplified SQL/Plus program). Can you provide
some simple editing of the SQL? Or can you implement escaping to an
external editor, for example, vi ?
3. Make it possible for the user of your SQL program to set and change the
connection URL—via an environment variable, command-line parameter,
or even from within the program. Your SQL program will then be able to
query a variety of databases from various vendors.
Search WWH ::




Custom Search