Meaningless Drivel is fun!*
The moose likes JSP and the fly likes How to Edit Details in database using JSP page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to Edit Details in database using JSP page?" Watch "How to Edit Details in database using JSP page?" New topic
Author

How to Edit Details in database using JSP page?

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
Hello Ranchers!!!
Here i'm doing a project with jsp and oracle..
Now what i want do is.. i want to search a particular name..
it is searching. and displaying the details.. in another page..
now..i added a new hyperlink "Edit contact details"
when i click that hyperlink..
it is opening another page..
there 4 text boxes are there!!

the fields in the database should be taken.. to that textboxes..
fields are
name , address, email, phone..

how can i get the details of the particular person.. in the text box..

for egs..

name to search = rony
next page!!
rony trivandrum rony@rony.com 2222222 <edit details>

here edit details is hyper link..

when i press that link..

these details displaying here should seen in
next page in each text boxes..

when i press the submit button..
i have to call the Update table Query..

but my problem is i cannot .. get the fields in textbox!!

with which command i can do that..

help me... please

i'm holding this probs with 2 days..

please ranchers
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I think you have to use a key to retrieve the information for each person.
Let's say you keep the users information in a map (key is string, value is information bean). Let's assume that this map is in the session.

We have two users in our database.
We use a map to store their information :

AAA->(rony trivandrum rony@rony.com 2222222)
BBB->(bob bobaddress bob@bob.com 3333333)

In your JSP page, you browse through the map (which is in the session) to get all the users information.
You can get the keys, and the value. You display it like this :

rony trivandrum rony@rony.com 2222222 <edit details>
bob bobaddress bob@bob.com 3333333 <edit details>
...

<edit details> is a hyperlink, right ? Let's say it points to "details.jsp"
Then you could do :
<a href="/details.jsp?key=AAA">edit details</a>
<a href="/details.jsp?key=BBB">edit details</a>
and so on.

In details.jsp, you retrieve the selected user's key, from the request parameters (parameter name is 'key'). You then use the key to retrieve the user information which is still in the session, and display it in each textbox.

I hope this is understandable

(There are other ways to do this)


[My Blog]
All roads lead to JavaRanch
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
Sebo Satou kurinosuke
What i need is the
String name = request.getParameter(nam);

i want to display this string in the textbox..

how can i... in jsp
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

<input type="text" name="name" value="<%= name %>"/>
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
sebo !!

can i hide this text box in html!!!

if so.. what command i have to give?


<input type="text" name="name" value="<%= name %>"/>
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

What do you mean by "hide this text box" ?
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
hide means..

i don't want to see the text box in the webpage..

but the textbox should be there!!
it should be hidden..

can i do that.. sebo?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

If you don't want to see it, then you don't put it there
You want to use ua hidden tag maybe ?
<input type="hidden"... />
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
sebo.. i fixed the problem..

actully.. what i do is..
i just put a layer..
and inside the layer i put the textbox..

and i made the visiblility of the layer: hidden

so. when i run the page in iexplorer..
it is not visible..



thank you.. sebo..
for fixing my problem..
thanks a lot..

this forum is really very helpful for me..
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
Thank you sebo..

<input type ="hidden" > was there

i don't know..

i just made.. the things very difficult.. na

any way thanks a lot for fixing my problem...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Edit Details in database using JSP page?
 
Similar Threads
get the hyperlink text to another jsp page?
edit tables in database
Knowning which link was clicked (take 2)
Delete doubt
in dropdown problem