• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate/Db2 Issue!  RSS feed

 
Kirtipur Itagol
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I'm using hibernate and Db2 with JSF. In the Db2 I have a table A, where I have a column B with two values. In the jsp I could directly/dynamically populate those two values in my selectonelistBox.
My question is, after I select a value from the list and click add or save button, I want the selected value to be saved in the database. So, do I need to create a separate table for the stored value, or do I need to do something with the hibernate?
Show me the way people!!
 
ansar basha
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kirtipur,

May be if you post how far u have done and what is ur approach, i think we
will be able to help. Looks like ur not getting the value u have selected
in the view, in action of save or add method if ur able to get the value
u should not have any problem of saving through hibernate.

Thanks
Ansar
 
Kirtipur Itagol
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ansar!
In the JSP, as soon as I click the add button, I can see the values selected in the datatable(same page). And after that I select save (I don't have any errors displayed in my log file). As far as my understanding, after hitting the save button, I want those displayed datas in the datatable be populated in the database, but i'm not seeing it.
I'm using DAO, service class/interface, controller, and model objects. From the lookup table, I display the values, Those selected values should be displayed in the table "some_table" in the database.
I think I have a correct mapping in the hibernate.xml. So, my question is how should I implement this (in the jsp, value="save" action="#{controller.savedata)") in my controller?
FYI each time the data is inserted( which is not being inserted currently!), it will generate a sequence code.
Thanks for the advice!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!