-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate insert statement from JSP page
PostPosted: Thu Dec 12, 2013 4:55 am 
Newbie

Joined: Thu Dec 12, 2013 4:47 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.