• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

writing data into sql database

 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have managed to get the information from the through beans in a jsf page1 and displaying them succeffully in the next page2 after clicking on a button page1.

Now my next objective is to write those details into a sql database. How do I proceed?
In the first page when the user clicks the button, then all the info should be written into a sql table. Please guide me. Thanks.

Regards
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When the user clicks a JSF commandButton or commandLink, the backing bean's action method is invoked (after all the form properties, if any have been set). This is where you'd put the logic that writes the data to the database.

Exactly how to write to the database - basic JDBC, an ORM framework such as Hibernate, or whatever - is up to you.
 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim.
 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I van write a method inside java class to update the database. But where do I store tha database details? I tried as below. But I get some error in web.xml file.

web.xml as below:


I created context.xml to store the details of database as below:




I am following an example from web to apply into my application. Hence something is missing which I am nto aware. I get error as "Invalid content was found starting with the element <resoure-ref>.

My web.xml is as below:



Can anyone tell me how to proceed further? Thanks.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic