• 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

how to individually get the data in jsp page

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
shiju nair
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
shiju nair
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
shiju nair
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
please anyone help me out of this problem.I have to get this done as soon as possible.
thanks in advance.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
shiju nair
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
shiju nair
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
shiju nair
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
shiju nair
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No need to apologize. The guidelines are there to help you get better and quicker answers.
 
reply
    Bookmark Topic Watch Topic
  • New Topic