java 访问Lotus Notes

Lotus Notes

采用本地访问方式:

(1)步骤一:本机服务器安装 Lotus Notes 客户端 32位

(2)步骤二:准备 开发环境:jdk1.7 32  (因為Lotus Notes 客戶端是32位, JDK 64 位加载报错)

(3)核心代码:

package com.maxnerva.cloud.lotusnotes.util;

import lombok.extern.slf4j.Slf4j;

import lotus.domino.NotesException;
import lotus.domino.NotesFactory;
import lotus.domino.NotesThread;
import lotus.domino.Database;
import lotus.domino.Session;


@Slf4j
@Component
public class TransferToNotesUtil {

    private static String password = "password";

    private static String ip = "IP";

    private static String user = "test.nsf";

   


    public static Database getDataBase() throws NotesException {
        NotesThread.sinitThread();
        Session session = null;
        session = NotesFactory.createSession((String) null, (String) null, password);
        Database database = session.getDatabase(ip, user, true);
        boolean open = database.isOpen();
        if (!open) {
            database.open();
        }
        return database;

    }

    public static void main(String[] args) throws NotesException {
        getDataBase();
    }

}

pom.xml :引入 Notes.jar

注意:

1. Notes.jar 来自 Lotus Notes 客户端的安装后的安装文件中

2.配置环境变量Notes 客户端环境变量:

C:\Program Files (x86)\IBM\Lotus\Notes\nlsxbe.dll

个人理解:Java 通过 Notes .jar访问nslxbe.dll 达到访问服务端目的


参考链接

1.https://mbd.baidu.com/ug_share/mbox/4a83aa9e65/share?product=smartapp&tk=c34eb2dc3460bee51ad78f0a48694aa4&share_url=https%3A%2F%2Fyebd1h.smartapps.cn%2Fpages%2Fblog%2Findex%3FblogId%3D114095995%26_swebfr%3D1%26_swebFromHost%3Dbaiduboxapp&domain=mbd.baidu.com

2.

Java访问Domino必需配置的服务器设置(转载) - 爱码网

你可能感兴趣的:(java)