wood burning stoves 2.0*
The moose likes JSP and the fly likes adding data to database 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 "adding data to database " Watch "adding data to database " New topic
Author

adding data to database

amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
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 ]

Thanks advance who ever answers this question.


regards
amit bhadre
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
Sorry I will ask only questions ..and I will write full sentences.

rgds
amit bhadre
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
I am sorry sir

it should be

regards
amit bhadre
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60732
    
  65

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

Joined: Jan 23, 2006
Posts: 124
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

Joined: Jul 06, 2005
Posts: 1016
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: adding data to database
 
Similar Threads
Regarding Login
Error in Struts
folder
How to handle Multiple requests?
DB connection