Hi,
i want to display address of customer based on key.customer has two or more addresses.
i need to select key value in combo box.
based on key i need to print address.
opadid is key.
opcua1,opcua2,opcua3,opcua4 are address columns
How can write code in
jsp page in
struts.
public Map<
String,siteBean> getsiteaddressMap() {
String select = "select opadid , opcua1 ,opcua2 , opcua3 ,opcua4 from customer
Map<String,siteBean> siteAddressMap = new LinkedHashMap<String,siteBean>();
if (con != null) {
try {
PreparedStatement ps = con.prepareStatement(select);
ResultSet rs = ps.executeQuery();
while (rs.next()) {
siteBean sb = new siteBean(
rs.getString("opcua1"),
rs.getString("opcua1"),
rs.getString("opcua1"),
rs.getString("opcua1"),
rs.getString("opadid"));
siteAddressMap.put(sb.getAdid(),sb);
}
} catch (SQLException ex) {
ex.printStackTrace();
}
}
return siteAddressMap.isEmpty() ? null : siteAddressMap;
}
Thanks
[ March 03, 2008: Message edited by: Bhaskar Gara ]