Forums Register Login

writing data into sql database

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Thanks Tim.
+Pie Number of slices to send: Send
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.
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1420 times.
Similar Threads
Liferay Portlet with JSF Portlet bride-Problem
Creating a custom scope... (kinda long)
popup form - howto get data ? from newbie
Inter portlet communication
When leaving a page need to set a boolean to false no matter
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:54:18.