Monday, December 31st, 2007
containing all of the information about the column as the data value. So, for all ResultSets that are generated, I create a Hashtable of column information that is then used by the ResultSet object and the ResultSetMetaData object to describe each column. Listing 10.19 shows the SimpleTextColumn class that is used to hold this information for each column. Listing 10.19 The SimpleTextColumn class. package jdbc.SimpleText; public class SimpleTextColumn extends Object { //———————————————————————- — // Constructor //———————————————————————- — public SimpleTextColumn( String name, int type, int precision) { this.name = name; this.type = type; this.precision = precision; } public SimpleTextColumn( String name, int type) { this.name = name; this.type = type; this.precision = 0; } public SimpleTextColumn( String name) { this.name = name; this.type = 0; this.precision = 0; } public String name; public int type; public int precision; public boolean searchable; public int colNo; public int displaySize; public String typeName; } Note that I have used several constructors to set up various default information, and that all of the attributes are public. To follow object-oriented design, I should have provided a
You need web hosting, easy to use web template and great support. What else could I ask for?All of our reseller accounts include free web hosting templates just check web hosting templates for more information.