Forums Register Login

how to individually get the data in jsp page

+Pie Number of slices to send: Send
hi,
I am badly stuck into this problem.Please look into it and find a solution.
I am using ms-access and jsp.
my database structure is as given below:

----------------------------------------------------------
m_emp_no|from_date|to_date|approver|status|
___________________________________________
1002 | 22/9/2008 | 23/9/2008|1003 |pending
1004 | 29/9/2008 | 30/9/2008|1003 |pending
2044 | 15/9/2008 | 16/9/2008|3076 |pending

------------------------------------------------------
now this is exactly a leave apply scenario where a page is displayed and the user has to fill in the details to apply leave.then the approver has to approve that leaves so even, he should get the details in his account.
for example here 1003 has to approve leaves for 1002 & 1004.i am able to fetch data from database for the particular approver here is the coding:

------------------------------------------------------------
but the problem is that how do i approve leaves individually because when i use the coding given below i am able to approve only the first row data.
i want to approve leaves for everyone but based on m_emp_no.
update.jsp:


please help me out .
thanks in advance.
+Pie Number of slices to send: Send
Use Following prepared statement
ps=con.prepareStatement("update emp_leave_application set status='"+approved+"' where approver='"+username+"' and m_emp_no='"+r.getInt("m_emp_no")+"'");

Regards
+Pie Number of slices to send: Send
hi sagar,
when i changed the code as you suggested it is updating the database related to its first entry i.e when i select approved for 1002 and cancelled for 1004 it is updating both as approved.
i think the values which i am retrieving is a single value ,used in the above code in update.jsp.

because when i use
it gives me only one value else it should give me both the values.so there is problem with retrieving values but i am not able to find it, or else the coding is not proper in the first jsp above.
please find a solution
thanks in adavance.
+Pie Number of slices to send: Send
hi sagar,
when i changed the code as you suggested it is updating the database related to its first entry i.e when i select approved for 1002 and cancelled for 1004 it is updating both as approved.
i think the values which i am retrieving is a single value ,used in the above code in update.jsp.

because when i use
it gives me only one value else it should give me both the values.so there is problem with retrieving values but i am not able to find it, or else the coding is not proper in the first jsp above.
please find a solution
thanks in adavance.
+Pie Number of slices to send: Send
hello,
please anyone help me out of this problem.I have to get this done as soon as possible.
thanks in advance.
+Pie Number of slices to send: Send
It is not good to have that much Java code in your JSP,consider using model classes.

approved for 1002 and cancelled for 1004 it is updating both as approved.


Maybe you need to modify your update query or you need two of them.
Moreover I dont see this as a JSP problem, maybe one of the moderators put it in its right place.
+Pie Number of slices to send: Send
hi amit,
but i dont understand one thing as i have stated above that when i retrieve the values from the database in the jsp page i get all the rows but when i retrieve the values from the page using

why does it give me only one value or is it that i have not placed te list box properly .is there any other way to get all the values from the page.
please suggest me.
thanks in adavance.
+Pie Number of slices to send: Send
Is there no one to help me out .
As amit stated that there is a problem with the update statement it might be true but unless and until we get the values how can we get the exact result using proper update statement also because as i said i am getting only one value from the code when i try to get values from the jsp page.

if any problem please refer the first coding and help me out with some suggestion as to how to get all the values.
please its very urgent.
thanks in advance.
+Pie Number of slices to send: Send
hello everyone,
I am asking for help from when and no body is responding to me .
there is no one in this forum who could help me out.
atleast just guide me what has to be done.
its very urgent .there are hardly any days left out.
please guys help
+Pie Number of slices to send: Send
No one here is obligated to help you. Being petulant will just tick people off and your posts will just end up being ignored.

Please read this and please read this.
+Pie Number of slices to send: Send
hi bear,
sorry i was just in a hurry to get things done.i will wait till the ranchers find a solution and by the mean time ,even i am trying from my side to get the solution.
thank you
+Pie Number of slices to send: Send
No need to apologize. The guidelines are there to help you get better and quicker answers.
I RELEASE YOU! (for now .... ) Feel free to peruse this 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 4591 times.
Similar Threads
jsp:include and c:import combination/nesting
Client side validation problem
inserting data to a table
Why this problem???
Make rows not appear when certain row value appears
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:16:32.