1.在Java中調(diào)用domino對(duì)象需要
import lotus.domino.*;
2.Java程序可以是application,domino agent,applet,servlet
3.Notes7.0最高支持jdk1.4.2
4.用到的jar包Notes.jar, NCSO.jar, domtags.jar
5.服務(wù)器需要開(kāi)啟CORBA-based remote (IIOP),服務(wù)器的http和diiop服務(wù)必須開(kāi)啟,可在notes.ini中查看ServerTasks=<any other tasks>,http,diiop
6.Java的堆棧內(nèi)存不能小于64M,不然在訪問(wèn)nhttp.exe時(shí)會(huì)出錯(cuò)嗅骄,如果notes.ini中沒(méi)設(shè)置榛搔,默認(rèn)為64M
7.需要配置服務(wù)器文檔
1).端口—Internet端口---DIIOP 可以設(shè)置domino iiop遠(yuǎn)程訪問(wèn)的權(quán)限
2).Internet協(xié)議—DIIOP可以設(shè)置多線程
3).安全性---編程限制 可以設(shè)置運(yùn)行java agent的權(quán)限
8.更新了服務(wù)器iiop配置可以通過(guò)tell diiop refresh來(lái)更新
9.對(duì)于獨(dú)立的應(yīng)用程序需要設(shè)置
set CLASSPATH=.;c: otesdatadominojavaNCSO.jar;c: otesNotes.jar
1).Notes.jar提供了本地調(diào)用domino對(duì)象的包
2).NCSO.jar提供了遠(yuǎn)程調(diào)用domino對(duì)象的包 和 cso 的包
3).NCSO.jar和NCSO.cab基本一樣,就是壓縮格式不同
10.運(yùn)行環(huán)境的要求
1).本地application 需要domino server , domino designer or Notes client , Notes.jar in classpath
2).遠(yuǎn)程application 需要 NCSO , NCSO in classpath
3).Domino agent 需要 Notes.jar in classpath
4).applet 需要 domino server
11.本地訪問(wèn)可以通過(guò)NotesThread class public void runNotes()
擴(kuò)展方法1. Runnable public void run()
擴(kuò)展方法2. sinitThread()
擴(kuò)展方法3. stermThread() 靜態(tài)線程
12.內(nèi)存管理可以通過(guò)NotesThread class 中的 recycle 方法 和多線程
13.java agent 繼承 AgentBase class 繼承 NotesThread class public void NotesMain()
14.applet 繼承 AppletBase 方法有 notesAppletInit() notesAppletStart() 和 notesAppletStop() 要訪問(wèn)domino線程需要NotesThread 可以用 AppletBase.isLocal()判斷是本地的還是遠(yuǎn)程的璧微,通過(guò)NotesThread.sinitThread 初始化線程,NotesThread.stermThread 中止線程
15.session類(lèi)在java中的初始化
1).application local
NotesFactory createSession(),
createSessionWithFullAccess(),
createSession(null, null, String pwd),
createSessionWithFullAccess(String pwd),
createSession(null, String user, String pwd), or createSession(null, "", "")
2).application remote
createSession(String host, "", "") or createSession(String host, String user, String pwd)
3).agents
AgentBase.getSession()
4).applets
AppletBase.openSession() or openSession(String user, String pwd) and closeSession(Session session)
注: 其中的 user 和 pwd 為id 名稱(chēng) 和 Internet密碼
5).SSL
NotesFactory.createSession(String host, String args[], String user, String pwd) and specify "-ORBEnableSSLSecurity" for args(0)
6).Sign-on
createSession(String host, String token),
createSession(String host, org.omg.SecurityLevel2.Credentials token), createSession(String host, null), or createSession(String host, HttpServletRequest request)
16.Debug 在前端運(yùn)行代理System.out 和 System.err 信息顯示在 Java 控制臺(tái)
對(duì)于本地的定時(shí)代理蚯舱,信息顯示在Domino log
17.要把代理信息打印到瀏覽器上肠缨,需要java.io.PrintWriter中的getAgentOutput() PrintWriter object中的println
18.Eclipse遠(yuǎn)程訪問(wèn)時(shí)報(bào)錯(cuò)Exception in thread "main"
java.lang.UnsatisfiedLinkError: no nlsxbe in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at lotus.notes.NotesThread.load(Unknown Source)
at lotus.notes.NotesThread.<clinit>(Unknown Source)
at lotus.test.AccessDomino.main(AccessDomino.java:16)
解決方法:在系統(tǒng)變量path中添加notes目錄
19.推薦用IOR的方式訪問(wèn)Domino服務(wù)器,其它方式可能需要服務(wù)器設(shè)置為匿名訪問(wèn)潜沦,用IOR匿名和不允許匿名都可以, 通過(guò)
String Ior=NotesFactory.getIOR("127.0.0.1","admin","password");
首先取到Ior萄涯;服務(wù)器名根據(jù)你的 實(shí)際情況填寫(xiě),用戶名和密碼是登錄internet的用戶名和密碼唆鸡,如果是匿名可以不寫(xiě),創(chuàng)建Session對(duì)象
localSession = NotesFactory.createSessionWithIOR(Ior,"admin","password");
然后就可以多數(shù)據(jù)庫(kù)進(jìn)行操作了