private String infoCols[]={ first_name ,  last_name ,
 email_address ,  date_joined ,  birth_date ,  address };
...
String sqlStmt= select * from userinfo where
username=' +username+ ' ;
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(sqlStmt);
if (rs.next) {
for (int i=0; i
String info=infoCols[i];
session.putValue(info, rs.getString(info));
}
}
Figure 69. Java code to populate user information in the Session object
c. user profile
In a similar fashion, we perform a select of the relevant columns from
the USERPROFILE table. If the particular category (as400, netfinity
and so on) does not have a null value, it means the user has expressed
an interest in this category, and, thus, we should set the value in the
Session object.
Once again, we use an array of strings called profileCols as a filter.
The code looks something like Figure 70.
private String profileCols[]={ as400 ,  netfinity ,  ncf ,  nw ,
 s390 ,  rs6000 ,  scalable ,  vm ,  vse ,  windows ,  other };
...
String sqlStmt= select * from userprofile where
username=' +username+ ' ;
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(sqlStmt);
if (rs.next) {
for (int i=0; i
String category=profileCols[i];
if (category=! null) session.putValue(category, category);
}
}
Figure 70. Java code to populate user profile information in the Session object
92
Linux Web Hosting with WebSphere, DB2, and Domino




  

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