int rs = stmt.executeUpdate(sqlStmt);
stmt.close();
if (rs != 1) {
raiseError("USERINFOINSERT: result rows !=1 from " + sqlStmt,
failurepage, req, res);
return;
}
// insert userverify
sqlStmt = "insert into userverify (username,password) values ( " + username
+ " , " + password + " )";
stmt = con.createStatement();
rs = stmt.executeUpdate(sqlStmt);
stmt.close();
if (rs != 1) {
raiseError("USERVERIFYINSERT: result rows !=1 from " + sqlStmt,
failurepage, req, res);
return;
}
// insert userprofile
sqlStmt = "insert into userprofile
(username,as400,netfinity,ncf,nw,s390,rs6000,scalable,vm,vse,windows,other) values ( " +
username + " ,";
for (int i = 0; i < profileCols.length   1; i++) {
if (req.getParameter(profileCols[i]) != null) {
sqlStmt = sqlStmt + " y ,";
} else {
sqlStmt = sqlStmt + "null,";
}
}
if (req.getParameter(profileCols[profileCols.length   1]) != null) {
sqlStmt = sqlStmt + " y )";
} else {
sqlStmt = sqlStmt + "null)";
}
session.putValue("SQLstmt", sqlStmt);
stmt = con.createStatement();
rs = stmt.executeUpdate(sqlStmt);
stmt.close();
if (rs != 1) {
raiseError("USERPROFILEINSERT: result rows !=1 from " + sqlStmt,
failurepage, req, res);
return;
}
// login automatically successful, so set cookie values for everything
session.putValue("username", username);
session.putValue("password", password);
for (int i = 0; i < infoCols.length; i++) {
if (req.getParameter(infoCols[i]) != null) {
session.putValue(infoCols[i], req.getParameter(infoCols[i]));
}
}
for (int i = 0; i < profileCols.length; i++) {
if (req.getParameter(profileCols[i]) != null) {
session.putValue(profileCols[i], req.getParameter(profileCols[i]));
}
}
res.callPage(successpage, req);
}
return;
} // end registration
// delete takes username and password from cookie values
if (action.equals("delete")) {
String username = getUsername(session);
Appendix B. Java code relating to DB2
153




  

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