The following lines are column definitions for a sample database administration application.
ACCOUNT_NUMBER CHAR(14)
AMOUNT INTEGER
DESCRIPTION VARCHAR(50)
THE_DATE DATE
import java.util.Enumeration; import java.sql.*; import com.ibm.btt.base.*; import com.ibm.btt.services.jdbc.*; public class StoreTableManagement { /** * This class creates a store table that will later on be used by the applications requesting the store services */ public static void main(String args[]) throws java.io.IOException, DSEObjectNotFoundException { JDBCStoreSchemaGenerator ssg =null; // 1) Instantiate JDBCStorechemaGenerator... ssg = new JDBCStoreSchemaGenerator(); // 2) Connect to Database... try { ssg.loadDriver("COM.ibm.db2.jdbc.net.DB2Driver"); ssg.connect("jdbc:db2://myhs:8888/mydb","MYUSER","MYPASS"); } catch (Exception e ) { e.printStackTrace(); return; } // 3) Create the store table String tableDefinition = "ACCOUNT_NUMBER CHAR(14), AMOUNTINTEGER, DESCRIPTION VARCHAR(50), THE_DATE DATE"; String tableName = "StoreTable"; try { // Generating Database Table... ssg.generateTable(tableName, tableDefinition);> // Close the database connection ssg.disconnect(); } // End try catch (Exception e ) { e.printStackTrace(); } }