2015-01-22 7 views
-1

안녕하세요, 저는 Lotus Script를 처음 사용했습니다.로터스 메모에 자바 에이전트에 의해 domino desiger DB에 액세스하는 방법?

데이터베이스에 액세스하는 Java 에이전트를 실행하여 양식에 저장된보기를 읽으려고합니다.

public class JavaAgent extends AgentBase { 

    public void NotesMain() { 

     try { 
      Session session = getSession(); 
      AgentContext agentContext = session.getAgentContext(); 
      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase(); 
      View view = db.getView("PetView"); 
      view.setAutoUpdate(false); 
      view.setAutoUpdate(false); 
      ViewEntryCollection vec = view.getAllEntries(); 
      System.out.println("Parent is " + 
      vec.getParent().getName()); 
      System.out.println("Number of entries = " + 
      vec.getCount()); 
      ViewEntry tmpentry; 
      ViewEntry entry = vec.getFirstEntry(); 
      while (entry != null) { 
      System.out.println("Entry is at position " + 
      entry.getPosition('.')); 
      tmpentry = vec.getNextEntry(); 
      entry.recycle(); 
      entry = tmpentry; 
      } 
     } catch(Exception e) { 
      e.printStackTrace(); 
     } 
    } 
} 

내 디버그 콘솔 O/P는 다음과 같습니다 :

내가 코드

아래

업데이트

내 코드입니다 내가 틀렸다 경우

Parent is PetView 
Number of entries = 8 
Entry is at position 1 
Entry is at position 2 
Entry is at position 3 
Entry is at position 4 
Entry is at position 5 
Entry is at position 6 
Entry is at position 7 
Entry is at position 8 

나를 정정

감사 .

답변

0

데이터베이스를 로컬로 가져 오려면 서버 이름없이 getdatabase를 사용하십시오. = notessession.getdatabase

설정 데시벨 ("", "경로 \의 dbname.nsf")

0

귀하의 코드도보기에 액세스하려고하지 않습니다. 모든 문서가 포함 된 컬렉션에 액세스하고 있습니다.

View v = tempDb.getView("theViewNameOrAliasGoesHere"); 
:

이보기에 액세스하려면, 당신은 단지 같은 것을 필요
관련 문제