The specific focus of this article is on the data types of columns. In the following discussion, I will show you how to develop a reusable library of three Java classes that are organized in layers, from closest to the database to farthest. The farthest layer from the database becomes the nearest layer to the application that uses the library. Suppose you need to populate a table called emp in an organization database. Here is a sample data file that contains the table name on the first line, and a set of column names in the second.
Every subsequent line contains row data for the specified columns.
The structure of emp is shown in the top row of Figure 1. Not all columns in a table need to be populated at once. Also, the order in which the columns appear in the input file need not be the same as the order in which they are arranged in the database table. An index array maintains a mapping from the columns in the input to their respective positions in the table. In this example, the active column order array is the index array.