CachedDatabase.java


import java.util.*;

public class CachedDatabase {
    private Vector v = new Vector();
    SimpleSelect ss
    	= new SimpleSelect();
    
    Vector rows = null;
    
    public void init() {
    	ss.connect();
    	// The following is the table name!
    	ss.getQuery("Addresses");
    	rows = ss.getRows();
    	ss.close();

    }
    public void print() {
    	for (int i = 0; i < rows.size();i++) {
    	    print((String[])rows.elementAt(i));
    	    System.out.println();
    	}
    }
    public void print(String s[]) {
    	for (int i = 0; i < s.length;i++) {
    	    System.out.print(s[i]+",");
    	    
    	}
    	
    }
    public static void main(String args[]) {
    	CachedDatabase
    	    cd = new CachedDatabase();
    	cd.init();
    	cd.print();
    	
    }
    public void add(AddressRecord a) {
    	v.addElement(a);
    }
    public AddressRecord get(int i) {
    	return
    	    (AddressRecord) v.elementAt(i);
    }
    public int getSize() {
    	return v.size();
    }
}

[Back to Index]
This document was generated automatically by Kahindu.
Kahindu