需要用到NCSO.JAR文件
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="lotus.domino.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'JavaDomino.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
asdfsajfksahfakjshfkja
<%
Session sess;
Database db;
View view;
Document doc;
String host = "",user = "", pawd = "";
try{
//第一个参数为url服务器地址加上iiop的端口号
//第二参数为用户Notes
//第三个参数为用户的Internet密码
sess = NotesFactory.createSession("192.168.1.100:63148","admin","password");
host = sess.getServerName();
user = sess.getUserName();
System.out.println("host: " + host + "; user: " +user);
db = sess.getDatabase(host,"oadata/AIS_Org.nsf",false);
if(null==db)
{
System.out.println("为空");
}else{
System.out.println("数据库服务开启了");
}
if(db.isOpen()){
System.out.println("sssssssssssssssssssssss");
view = db.getView("v_all_people");
if(null==view)
{
System.out.println("视图为空");
}else{
System.out.println("视图不为空");
}
doc = view.getFirstDocument();
if(null==doc)
{
System.out.println("DOC对象为空");
}else{
System.out.println("DOC对象不为空");
}
out.println(db.getTitle()+" : "+doc.getItemValueString("TXTUSERNAME"));
String usernameall=doc.getItemValueString("TXTUSERNAME");
String userinfo[]=usernameall.split("/");
System.out.println(userinfo.length);
}else{
System.out.println("数据库没有打开");
}
}catch(NotesException ne){
System.out.println("error: " + ne.id + " ==> " + ne.getMessage());
}
%>
</body>
</html>
java连接domino lotus.domino
猜你喜欢
转载自liqinglong321.iteye.com/blog/1094872
今日推荐
周排行