怎么查找domino数据库中写入的数据
1个回答
推荐于2016-02-26
展开全部
session = NotesFactory.createSessionWithIOR(ior,username,password);
logger.info("连接邮件服务器成功" );
//得到数据库
database = session.getDatabase(session.getServerName(), mailFile, false);
Document doc = database.createDocument();
View vw = null;
View vw1 = database.getView("Incidents\\All");
if(null == vw1){
logger.info("没有符合条件的视图");
return null;
}
int aa = vw1.FTSearch("测试邮件");
vw1.getAllDocumentsByKey("");
Document doc1 = vw1.getFirstDocument();
int begin = 0;
while(doc1!=null){
Vector columnNames = vw1.getColumns();
if(begin==0){
System.out.println("columnNames -- "+columnNames+" -- end");
}
//------------------------------------------------------------------------------
Vector srVector = doc1.getColumnValues();
//详细列
Vector itemVector = doc1.getItems();
String subject = (String)doc1.getItemValue("Subject_NAV").get(0);
String content = (String)doc1.getItemValue("Findings_NAV").get(0);
String author = (String)doc1.getItemValue("Author_NAV").get(0);
String recipients = (String)doc1.getItemValue("Recipients").get(0);
DateTime created = (DateTime)doc1.getItemValue("Created_NAV").get(0);
System.out.println("发送人="+author+" 标题="+subject+" 内容="+content+" 接收人="+recipients+" 生成日期="+created);
System.out.println("============="+itemVector);
System.out.println("begin -- "+srVector+" -- end");
//------------------------------------------------------------------------------
begin++;
doc1 = www.hnnedu.com vw1.getNextDocument(doc1);
}
str = "success";
} catch (Exception ex) {
if(ex instanceof lotus.domino.NotesException){
logger.info("通过CORBA访问数据库发生错误,错误代码为"+((lotus.domino.NotesException)ex).id);
}
logger.info("连接邮件服务器失败");
str = "fail";
ex.printStackTrace();
}finally{
if(database!=null){
try {
database.recycle();
} catch (NotesException e) {
e.printStackTrace();
}
}
if(session!=null){
try {
session.recycle();
} catch (NotesException e) {
e.printStackTrace();
}
}
}
logger.info("连接邮件服务器成功" );
//得到数据库
database = session.getDatabase(session.getServerName(), mailFile, false);
Document doc = database.createDocument();
View vw = null;
View vw1 = database.getView("Incidents\\All");
if(null == vw1){
logger.info("没有符合条件的视图");
return null;
}
int aa = vw1.FTSearch("测试邮件");
vw1.getAllDocumentsByKey("");
Document doc1 = vw1.getFirstDocument();
int begin = 0;
while(doc1!=null){
Vector columnNames = vw1.getColumns();
if(begin==0){
System.out.println("columnNames -- "+columnNames+" -- end");
}
//------------------------------------------------------------------------------
Vector srVector = doc1.getColumnValues();
//详细列
Vector itemVector = doc1.getItems();
String subject = (String)doc1.getItemValue("Subject_NAV").get(0);
String content = (String)doc1.getItemValue("Findings_NAV").get(0);
String author = (String)doc1.getItemValue("Author_NAV").get(0);
String recipients = (String)doc1.getItemValue("Recipients").get(0);
DateTime created = (DateTime)doc1.getItemValue("Created_NAV").get(0);
System.out.println("发送人="+author+" 标题="+subject+" 内容="+content+" 接收人="+recipients+" 生成日期="+created);
System.out.println("============="+itemVector);
System.out.println("begin -- "+srVector+" -- end");
//------------------------------------------------------------------------------
begin++;
doc1 = www.hnnedu.com vw1.getNextDocument(doc1);
}
str = "success";
} catch (Exception ex) {
if(ex instanceof lotus.domino.NotesException){
logger.info("通过CORBA访问数据库发生错误,错误代码为"+((lotus.domino.NotesException)ex).id);
}
logger.info("连接邮件服务器失败");
str = "fail";
ex.printStackTrace();
}finally{
if(database!=null){
try {
database.recycle();
} catch (NotesException e) {
e.printStackTrace();
}
}
if(session!=null){
try {
session.recycle();
} catch (NotesException e) {
e.printStackTrace();
}
}
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
今至电子科技有限公司
2024-08-23 广告
2024-08-23 广告
数据库备份是确保数据安全与业务连续性的关键环节。我们上海今至电子科技有限公司高度重视数据保护,定期执行全面的数据库备份策略。这包括使用先进工具和技术,对关键业务数据进行自动化备份,并存储在安全可靠的外部存储介质或云端。通过定期验证备份的完整...
点击进入详情页
本回答由今至电子科技有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询