• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to Edit Details in database using JSP page?

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 [email protected] 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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 [email protected] 2222222)
BBB->(bob bobaddress [email protected] 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 [email protected] 2222222 <edit details>
bob bobaddress [email protected] 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)
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<input type="text" name="name" value="<%= name %>"/>
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "hide this text box" ?
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic