This is the documentation for the code and examples to accompany the DDJ article <name here>.  Here is a brief explanation of the contents:

MemberTable.sql - the DDL to create the table used in the example program

ColumnInfo.java - a simple encapsulation of the information about a column of a database table.  Provides hashCode() and equals() implemenation to permit this class to be stored in a Hashtable and retrieved by using the object or the column's name.

DbGenerateClasses.java - the class that generates the code for a relational database table.  It requires a configuration file containing the database connection properties.  It is invoked by:  
java -DConfigFileName=<config file> DbGenerateTables <table1> [<table2> ... tablen>]

MemberTable.java - the class I generated from the Member table using DB2 UDB 7.1 and the DB2 jdbc driver.

Member.java - the implemenation of the business logic for the Member class.  Extends the basic funcationality of the generated MemberTable class.  Contains test code that lets you insert, update, and delete Members from the database.

DBUtils.java - a collection of static database utilities.  Their primary purpose is to generate and execute dynamic sql statements using the ColumnInfo information.  Data is passed to these methods as a java.util.Hashtable of ColumnInfo/value pairs.

sample.cfg - a sample configuration file, required by both DbGenerateClasses and the Member sample application.

I have tested this code with DB2 UDB 7.1 on Linux with JDK 1.1.8 and DB2 UDB 7.1 on Windows 98 with JDK 1.2.  See the notes in the code on platform specific work-arounds I employed or differences between the JDK versions or JDBC 1.0 versus 2.0.

Mark Seaman
mseaman@us.ibm.com



