| This book focuses on database metadata (data about data) or annotation-based code recipes for JDBC API for use with Oracle and MySQL. The book provides complete and working solutions for performing database metadata tasks using JDBC. You can cut and paste solutions from this book to build your own database metadata applications. All the solutions have been compiled and tested against two leading databases: MySQL and Oracle. This book is ideal for anyone who knows some Java (can read/write basic Java programs) and some JDBC (can read/write basic queries using JDBC and SQL) and wants to learn more about database and result set metadata. Each section of this book is a complete recipe (including the database setup, the solution, and the solutions for both MySQL and Oracle), so you can use the code directly in your projects (although sometimes you may need to cut and paste only the sections you need). You may adopt my solutions to other databases (such as Microsoft SQLServer, DB2, PostgreSQL) by just changing the database parameters (such as the driver, database URL, or database username/password).
This book provides solid solutions and guidelines for using JDBC metadata to solve tough problems, such as how to write customized metadata for RowSet(s) and how to retrieve your tables/views names from the database as a URL. Most of the solutions presented in this book have been used and tested in real-world database applications. In fact, I have designed and developed all the JDBC code for MyJeeves (http://myjeeves.ask.com) using the same philosophies you’ll find in this book. You can cut and paste the provided solutions and tailor them to your own JDBC metadata applications. For production environments, you should replace my getConnection() method with a production-quality connection pool management product (such as Apache’s DBCP or Excalibur). |