I have a jsp application I inherited. I have the following code and need to add a new query and display a value from another table where an id value matches the hidden value in the record and display a column that shows either an "A" or "B". Would anyone be able to help me understand how to do this in jsp?

Code:
<table class="entitylisting" width="100%">
<thead>
	<TR>
		<TH align='left'>Name</TH>
		<TH align='left'>Serial #</TH>
		<TH align='left'>Owner</TH>
		<TH align='left'>Market Segment</TH>
		<TH align='left'>Status Date</TH>
		<TH align='left'>SPR Qty</TH>
		<TH align='left'>Est Order Qty</TH>
		<TH align='left'>First Request</TH>
                          <TH align='left'>A or B</TH>

		<TH align='center' colspan='4'>Options</TH>
	</TR>
</thead>
<%	for (int i = 0; i < design_list.length; i++) {%>
	<TR>
		<TD id="<%=i%>_0"><%= design_list[i].getDesignDesc()%></TD>
		<TD id="<%=i%>_1"><%= design_list[i].getSerialNumber()%></TD>
		<TD id="<%=i%>_2"><%= design_list[i].getDesignOwnerName()%></TD>
		<TD id="<%=i%>_3"><%= DesignInputAide.getDesignInputByDesignIDAndInputName(design_list[i].getDesignID(), "MARKET_SEGMENT").getDesignInputValName()%></TD>
		<TD id="<%=i%>_4"><%= DateFormat.formatDBDateTime(design_list[i].getDesignStatDT())%></TD>
		<TD id="<%=i%>_5"><%= DesignInputAide.getDesignInputByDesignIDAndInputName(design_list[i].getDesignID(), "SPECIAL_PRICING_QTY").getDesignInputValName()%></TD>
		<TD id="<%=i%>_6"><%= DesignInputAide.getDesignInputByDesignIDAndInputName(design_list[i].getDesignID(), "EST_QTY").getDesignInputValName()%></TD>
		<%if(DesignInputAide.getDesignInputByDesignIDAndInputName(design_list[i].getDesignID(), "HIDDEN_FIRST_TIME_SPR").getDesignInputValName().equals("")){ %>
		<TD style="background-color:#FFFFCC" id="<%=i%>_7">Y</TD>
		<%}else if(DesignInputAide.getDesignInputByDesignIDAndInputName(design_list[i].getDesignID(), "HIDDEN_FIRST_TIME_SPR").getDesignInputValName().equals("Y")){ %>
		<TD style="background-color:#FFFFCC" id="<%=i%>_7"><%= DesignInputAide.getDesignInputByDesignIDAndInputName(design_list[i].getDesignID(), "HIDDEN_FIRST_TIME_SPR").getDesignInputValName()%></TD>
		<%}else{ %>
		<TD style="background-color:#FFFFFF" id="<%=i%>_7"><%= DesignInputAide.getDesignInputByDesignIDAndInputName(design_list[i].getDesignID(), "HIDDEN_FIRST_TIME_SPR").getDesignInputValName()%></TD>
		<%} %>
*****************I NEED TO DO ANOTHER CONNECTION AND QUERY ANOTHER TABLE HERE AND PULL A VALUE AND POPULATE IT BELOW BASED ON THE HIDDEN DESIGN ID****************************************

<TD>-----------NEED TO DISPLAY VALUE HERE--------------</TD>

<TD align='center' onMouseOver="changeBGColor(true,'<%=i%>');" onMouseOut="changeBGColor(false,'<%=i%>');"><A href="javascript: editDesignEval('<%= design_list[i].getProdID()%>', '<%= design_list[i].getUserID()%>', '<%= design_list[i].getDesignID()%>', '<%=status%>')"><img src='<%= hroot%>/images/small_edit_on.gif' border='0' alt='Edit this Design'></A></TD>
<%		if (!user_id.equals("")) {%>
		<TD align='center' onMouseOver="changeBGColor(true,'<%=i%>');" onMouseOut="changeBGColor(false,'<%=i%>');"><A href="javascript: promoteDesign('<%= design_list[i].getProdID()%>', '<%= design_list[i].getUserID()%>', '<%= design_list[i].getDesignID()%>', '<%=status%>')"><img src='<%= hroot%>/images/small_promote_on.gif' border='0' alt='Promote this Design'></A></TD>
<%		}%>
		<TD align='center' onMouseOver="changeBGColor(true,'<%=i%>');" onMouseOut="changeBGColor(false,'<%=i%>');"><A href="javascript: viewResults('<%= design_list[i].getDesignID()%>')"><img src='<%= hroot%>/images/small_results_on.gif' border='0' alt='View Design Results'></A></TD>
		<TD align='center' onMouseOver="changeBGColor(true,'<%=i%>');" onMouseOut="changeBGColor(false,'<%=i%>');"><A href="javascript: history('<%= design_list[i].getDesignID()%>')"><img src='<%= hroot%>/images/small_history_on.gif' border='0' alt='View Design History'></A></TD>

	</TR>
<%	}
}%>
</TABLE>