sqlStmt = sqlStmt + " y )";
} else {
sqlStmt = sqlStmt + "null)";
}
sqlStmt = sqlStmt + "where username= " + username + " ";
stmt = con.createStatement();
rs = stmt.executeUpdate(sqlStmt);
stmt.close();
if (rs != 1) {
raiseError("USERPROFILEINSERT: result rows !=1 from " + sqlStmt,
failurepage, req, res);
}
// must set cookie here!
// cookies for userinfo
for (int i = 0; i < infoCols.length; i++) {
if (req.getParameter(infoCols[i]) != null) {
session.putValue(infoCols[i], req.getParameter(infoCols[i]));
}
}
// cookies for userprofile
for (int i = 0; i < profileCols.length; i++) {
if (req.getParameter(profileCols[i]) != null) {
session.putValue(profileCols[i],
req.getParameter(profileCols[i]));
} else { // undef the interest category
session.removeValue(profileCols[i]);
}
}
res.callPage(successpage, req);
} else {
raiseError("The following error(s) have been detected.
Please correct
and try again:

" + toString(errors), failurepage, req, res);

}
} else {
uidPwdError(username, password, failurepage, req, res);
}
return;
}
raiseError("ACTIONERROR: Please report the following: 

ACTION \"" + action +

"\"not defined in URI " + req.getRequestURI() + "", failurepage, req, res);
res.callPage(failurepage, req);
} catch (SQLException e) {
e.printStackTrace();
session.putValue("error", "SQLERROR " + e.getMessage());
res.callPage(failurepage, req);
}
}
private String getPassword(HttpServiceRequest req) {
return req.getParameter("password");
}
private String getPassword(HttpSession session) {
return (String) session.getValue("password");
}
private String getUsername(HttpServiceRequest req) {
return req.getParameter("username");
}
private String getUsername(HttpSession session) {
return (String) session.getValue("username");
}
protected void initDB() {
try {
String url = "jdbc:db2:userstuf";
String uid = "db2inst1";
Appendix B. Java code relating to DB2
155




  

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