• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding data to database

 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI 2 all,

I want to add data from jsp page to data base.
I written connection for data base in scriplet page. In jsp page I have 1 textarea named as Notes.After clicking the submit button it should add to database through action/any type.
I am using backend database sql server.


Thanks in advance its urgent plz .....









cheers
amit bhadre

[ June 07, 2006: Message edited by: amit bhadre ]
[ June 07, 2006: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
amit bhadre,

Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here. In particular, please see EaseUp.

Please, also see:
UseRealWords
Abbreviations such as '2' instead of to and 'plz' instead of 'please' confound language translation software making it difficult for our non-English speaking members to read your post.

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I will ask only questions ..and I will write full sentences.

rgds
amit bhadre
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64615
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by amit bhadre:
Sorry I will ask only questions ..and I will write full sentences.

rgds
amit bhadre


Except for "rgds" it seems.
 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry sir

it should be

regards
amit bhadre
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64615
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what aspect of this issue are you having problems with? Obtaining the value of the text area? Writing the JDBC code? Something else?
 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to add login name and password to data base....?

So how to do that?

Thanks in advance.

tel me in two ways like by using bean and by scriplet also.
 
Stefan Evans
Bartender
Pie
Posts: 1669
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you do it an a few steps

1 - retrieve parameters from the web page into a variable. Often that is done with request.getParameter("nameOfFieldOnPage");
Alternatively you can use <jsp:useBean> and <jsp:setProperty> and populate a bean which has properties the same as the parameters from the page.
Or you can get a framework to do that for you.

2 - obtain a database connection. Preferably from a connection pool, or a bean provider, rather than writing database code into a JSP.

3 - run sql to insert the values (see JDBC Tutorial
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic