wood burning stoves 2.0*
The moose likes JSP and the fly likes Edit/Delete values in database using jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Edit/Delete values in database using jsp" Watch "Edit/Delete values in database using jsp" New topic
Author

Edit/Delete values in database using jsp

lisy jessica
Ranch Hand

Joined: Oct 27, 2010
Posts: 47
Hi

I am doing a project where i need to edit/delete values in database using jsp, the values display on jsp page, at the end of each row edit and delete buttons, when i click edit button it shd display all the values in that particular row in textboxes in jsp page and i need to modify the values, same is for delete, here is my code:

retrieve.jsp



editData.jsp



Please anyone can help me to solve this. Its very urgent.

Thanks in advance
Lissy
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61071
    
  66

Two things:

1) Please be sure to take the time to compose descriptive subjects for your posts. You will attract people who will can give you better and faster answers when your posts have good, descriptive subjects. For more information, please click this link ⇒ UseAMeaningfulSubjectLine.

Using a title such as "JAVA-JSP" isn't going to attract the attention of those who can best help you. Especially where you've already used this subject for another post.

You can change your subject line by clicking the button on your post.

2) Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

It looks like my advice of using code tags has been ignored.


[My Blog]
All roads lead to JavaRanch
Stan Weigh
Greenhorn

Joined: Jul 20, 2010
Posts: 6
Hi Lissy!
I would love you help you, but I can't find where your problem is. Is it in editing/deleting in mysql, or is it getting your buttons to do it, and so on?
You would attract more helpful persons if you stated where it is you're having a problem, and what your thoughts about it are.

Sincerely
Stan
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61071
    
  66

Step 1: No java code in JSPs! Factor the Java code out into Java classes.
lisy jessica
Ranch Hand

Joined: Oct 27, 2010
Posts: 47
Hi Mr.Stan,

I am not getting any error with this code simply the values are not editing in the textboxes, retrieve.jsp is displaying the database table values based on Aggregated Switch, at the end of each row i have EDIT and DELETE buttons, when i click EDIT button the values of that particular row shd edit in the textboxes in next jsp page, my editData.jsp code is incorrect i guess, am getting the textboxes empty thats the problem now....can you look into my editData.jsp code and correct it please its very urgent for my project,

This is my editData.jsp code:



so, with this code the values are not editing in the textboxes, am getting empty textboxes, Please help me.

Thanks in advance
Lissy.

Stan Weigh
Greenhorn

Joined: Jul 20, 2010
Posts: 6
The reason why your text boxes are empty, is that you only declare the strings before you set them as value of the text boxes:

You also have to assign them values before you use them in the form. One way you can fix this, is to move the code for your form under the JSP code,
so that you are certain that the strings have values, when you 'use' them.

An example for you:
This wouldn't work:
This would just give us an empty text box.
While this would do what you want:
And we would get a text box with the value: "A string" (without the quotes). (I have excluded some of the required syntax to make the examples work,
to make it easier to follow)

Hope this cleared something up for you. If not, feel free to ask again.
Good luck with your project!

Sincerely
Stan

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Edit/Delete values in database using jsp