Thanks for your supports. I'm improving in using the frameworks - Hibernate and Spring. My question is very simple: I have a dropdown on a jsp page that is populated from the database thus and a textbox that accepts input to be inserted into database based on the values selected in the dropdown: JSP code:
Code:
<tr>
<td><form:label path="ownerName" name = "ownerName">Select Overdraft User:</form:label></td>
<td><form:select path="ownerName" items = "${addMembersListToDropdown}"></form:select></td>
</tr>
<tr>
<td><form:label path="creditLimit">Enter an Amount:</form:label></td>
<td><form:input path="creditLimit"/></td>
</tr>
My quest is this: how do I write the query statement in the Dao class to do this insertion? I am very new to this so I'm inexperienced in calling jsp parameters within the j2ee classes. My sample DAO implementation class:
Code:
@Override
public void saveCyclosUsers(CyclosUsers cyclosUsers) {
sessionFactory.getCurrentSession().createSQLQuery("INSERT INTO lower_credit ownerName' = +'owner_name');
}
The pseudo of the code I intend writing is: "INSERT INTO lower_credit WHERE the value selected from the dropdown = owner_name". Please, kindly support. Appreciate.