Hi all,
Using jsp return a sql statement with multiple columns. Would like to display them (unitid, storageLen) in a <select>. How do I go about doing this???
Here is my code loading the sql statement to variables.
prepStmt = conn.prepareStatement("Select ent.incustdashid, ent.unitid, unit.storageLen " +
"From entitlements ent, company_service_unit unit " +
"Where ent.companyID = unit.companyID " +
"And ent.svcNum = unit.svcNum " +
"And ent.unitID = unit.unitID " +
"And ent.unitType = unit.unitType " +
"And s_usid = '900100p' " +
"And opid = 'admin2' " +
"Order By unitid"
ResultSet resultSet = prepStmt.executeQuery();
while(resultSet.next()) {
yaccounts.addElement(resultSet.getString("unitid");
ystorageLen.addElement(resultSet.getString("storageLen");
public Vector getyAccounts() {
return yaccounts;
}
public Vector getystorageLen() {
return ystorageLen;
}
Here is my code for the <select>:
<select name="AvailAccounts" multiple size="10" style="width:240px;" width="235">
<%
for(int i=0;i<accountView.getnAccounts().size();i++) {
%>
<option><%= "[" + accountView.getnAccounts().elementAt(i) + "]" + " " + "[" + "Bai Information will be placed here..." + "]" %></option>
<%
}
%>
</select>
I am getting the accounts ok, but I need to add the column storageLen in with accounts.
Any help would be appreciated.
Thanks.
Using jsp return a sql statement with multiple columns. Would like to display them (unitid, storageLen) in a <select>. How do I go about doing this???
Here is my code loading the sql statement to variables.
prepStmt = conn.prepareStatement("Select ent.incustdashid, ent.unitid, unit.storageLen " +
"From entitlements ent, company_service_unit unit " +
"Where ent.companyID = unit.companyID " +
"And ent.svcNum = unit.svcNum " +
"And ent.unitID = unit.unitID " +
"And ent.unitType = unit.unitType " +
"And s_usid = '900100p' " +
"And opid = 'admin2' " +
"Order By unitid"
ResultSet resultSet = prepStmt.executeQuery();
while(resultSet.next()) {
yaccounts.addElement(resultSet.getString("unitid");
ystorageLen.addElement(resultSet.getString("storageLen");
public Vector getyAccounts() {
return yaccounts;
}
public Vector getystorageLen() {
return ystorageLen;
}
Here is my code for the <select>:
<select name="AvailAccounts" multiple size="10" style="width:240px;" width="235">
<%
for(int i=0;i<accountView.getnAccounts().size();i++) {
%>
<option><%= "[" + accountView.getnAccounts().elementAt(i) + "]" + " " + "[" + "Bai Information will be placed here..." + "]" %></option>
<%
}
%>
</select>
I am getting the accounts ok, but I need to add the column storageLen in with accounts.
Any help would be appreciated.
Thanks.