out.println("" + key + "" + session.getValue(key) +
"");
}
out.println("

");

// contents of database tables of most interest to us
try {
// contents of userinfo
out.println("Contents of userinfo:

");

String sqlStmt = "select * from userinfo";
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sqlStmt);
ResultSetMetaData rsmd = rs.getMetaData();
int cols = rsmd.getColumnCount();
while (rs.next()) {
for (int col = 1; col <= cols; col++) {
out.print(rs.getString(col) + ":");
}
out.println("

");

}
stmt.close();
out.println("

End contents of userinfo

");

// contents of userverify
out.println("Contents of userverify:

");

sqlStmt = "select * from userverify";
stmt = con.createStatement();
rs = stmt.executeQuery(sqlStmt);
rsmd = rs.getMetaData();
cols = rsmd.getColumnCount();
while (rs.next()) {
for (int col = 1; col <= cols; col++) {
out.print(rs.getString(col) + ":");
}
out.println("

");

}
stmt.close();
out.println("

End contents of userverify

");

} catch (SQLException e) {
e.printStackTrace();
out.println(e.getMessage());
}
out.println("");
session.invalidate();
} catch (Exception e) {
e.printStackTrace();
}
}
public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException {
doService(req, res);
}
public void doPost(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException {
doService(req, res);
}
protected synchronized void doService(HttpServletRequest req1, HttpServletResponse res1)
throws ServletException, IOException {
// cast req and res to from ...Servlet... to ...Service...
HttpServiceRequest req = (HttpServiceRequest) req1;
HttpServiceResponse res = (HttpServiceResponse) res1;
// obtain session object
HttpSession session = req.getSession(true);
// obtain action to perform
String action = req.getParameter("action");
Appendix B. Java code relating to DB2
149




  

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