java可以访问操作lotus domino数据库吗?
jdbc方式应该不能在jsp或javabean中使用吧,因为它会弹出密码输入框让你输入密码的;使用corba应该是可以的;第一种方式就不知道了,因为它要依靠客户端的。
第一种方式的例程:
import lotus.domino.*;
import java.net.*;
import java.io.*;
import java.util.*;
public class ConnectToDomino
{
Session session = null;
String strServer = null;
String strUserName = null;
String strPassWord = null;
//构造函数
public ConnectToDomino(String Server,String User,String Pass) {
strServer = Server;
strUserName = User;
strPassWord = Pass;
setConnection();
}
//建立连接
public boolean setConnection() {
if(strServer==null || strUserName==null || strPassWord==null) return false;
try {
System.out.println("用户登录:" + strServer + "\t" + strUserName);
String IOR=GetIOR();
if(IOR!="")
System.out.println("成功取得IOR,开始创建session.....");
else
System.out.println("获取IOR失败!");
//session = NotesFactory.createSession(strServer,strUserName,strPassWord);
//session = NotesFactory.createSession(strServer,"","");
//session = NotesFactory.createSessionWithIOR(IOR); //匿名
session = NotesFactory.createSessionWithIOR(IOR,strUserName,strPassWord); //用户身份
System.out.println("成功登陆,登录信息:\n服务器名称:" + session.getServerName() + "\n登录用户名:" +
session.getUserName() + "\n");
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
//获取IOR
public String GetIOR() {
InputStream bin;
String Result="";
int character;
try{
URL url = new URL("http://"+strServer+"/diiop_ior.txt");
bin = url.openStream();
while((character=bi