Java application access notes?

Now,I can use java application to access lotus database,I can get Form and View infomations.The problem how can I get Document?The following is source code:

import java.io.*;

import javax.servlet.*;

import javax.servlet.http.*;

import lotus.domino.*;

import java.util.*;

import lotus.dco.beans.DCOSession;

public class DominoTest {

public static void main(String[] args) {

    try {

        DCOSession ds = new DCOSession();

        ds.login("server1", "sungoalname server1", "123456");

        Session s = ds.getSession();

        Database db = s.getDatabase("","person_card.nsf");            //access person_card database

        Vector views = db.getViews();

        System.out.println("views.size()="+views.size());

        View view1 = db.getView("地区");

        Vector coloumns = view1.getColumns(); //success to get coloumns

        lotus.domino.Document doc = view1.getFirstDocument();   //I have create two document with lotus notes ,but the doc is null

        if (doc == null) {

            System.out.println("doc is null");

        }

        int i=0;

    while (doc != null) {

    	System.out.println(i);

    	i++;

    	System.out.println("所在地区=");

    	System.out.println((String)doc.getItemValueString("所在地区"));

    	doc = view1.getNextDocument(doc); //获得下一个文档

    }

        view1.recycle();

        db.recycle();

        s.recycle();

        

    }

    catch(Exception e) {

        e.printStackTrace();

        

        

    }

}

}

Could someone give me some advice??

Subject: Java application access notes?

Is your application resides on a remote server other than local Domino server?

I am interested to know how to setup Tomcat app server in eclipse to allow java app or servlet accessing Domino objects.