Appendix C. Java code relating to Domino database
This appendix provides listings of Domino related Java codes.
C.1 Java servlet TestDomino
import Java.io.*;
import Java.util.*;
import Javax.servlet.*;
import Javax.servlet.http.*;
import lotus.domino.*;
public class TestDomino extends HttpServlet {
public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
String title=null;
String dbName;
String host;
/* Get parameter name and value */
dbName=req.getParameter( db );
host=req.getParameter( host )+ : +req.getParameter( port );
res.setContentType("text/html");
ServletOutputStream out = res.getOutputStream();
out.println("");
out.println("Intro Servlet");
out.println("");
try{
Session s=NotesFactory.createSession(host);
Database db=s.getDatabase(s.getServerName(), dbNameValue);
/* Retrieve database title */
title=db.getTitle();
}
catch(NotesException ex) {
out.println(ex.id + " " + ex.text);
}
out.println("

The title of "+dbNameValue+".nsf is \""+title+"\"

");
out.println("");
}
}
  Copyright IBM Corp. 2000
159




  

Home

About Services Network Support FAQ Order Contact
 

Linux Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved