Net.Data provides a set of interfaces in a class called DTW_Applet.class, which you can use with your Java applets to help process the PARAM tags that are generated for table variables. You can create an applet that extends this interface to call the routines from your applet.
Net.Data provides these interfaces:
To access the interfaces, use the EXTENDS keyword in your applet code to subclass your applet from the DTW_APPLET class, as shown in the following example:
import java.io.*;
import java.applet.Applet;
public class myDriver extends DTW_Applet
{
public void init()
{
super.init();
if (GetNumberOfTables() > 0)
{
String [] tables = GetTableNames();
printTables(tables);
}
}
private void printTables(String[] tables)
{
String table_name;
for (int i = 0; i < tables.length; i++)
{
table_name = tables[i];
printTable(table_name);
}
}
private void printTable(String table_name)
{
int nrows = GetNumberOfRows(table_name);
int ncols = GetNumberOfColumns(table_name);
System.out.println("Table: " + table_name + " has " + ncols + " columns and
" + nrows + " rows.");
String [] col_names = GetColumnNames(table_name);
System.out.println("------------------------------------------------------");
for (int i = 0; i < ncols; i++)
System.out.print(" " + col_names[i] + " ");
System.out.println("\n----------------------------------------------------");
String [][] mytable = GetTable(table_name);
for (int j = 0; j < nrows; j++)
{
for (int i = 0; i < ncols; i++)
System.out.print(" " + mytable[i][j] + " ");
System.out.println("\n");
}
}
}