Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners send multiple textbox vaues in to an jsp form to store them in a DB table

Have Programming Question? Ask it here!
 
 
 


Vinay KP
send multiple textbox vaues in to an jsp form to store them in a DB table
1 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners


Hi sir... I am not getting how can i send the multiple input text box values in to an jsp file with additional values to store those values in to an database table.

Please help me...... looking forward to hear from you...


Advertisement
View Answers

December 6, 2010 at 2:53 PM


Hi Friend,

Try the following code:

1)form.jsp:

<html>
<form method="post" action="insert.jsp">
<table>
<tr><td>Name:</td><td><input type="text" name="name"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)insert.jsp:

<%@page import="java.sql.*"%>
<%
String name=request.getParameter("name");
String address=request.getParameter("address");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           Connection con = DriverManager.getConnection("jdbc:odbc:student");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into user(name,address) values('"+name+"','"+address+"')");
           out.println("Data is inserted successfully");
%>

Thanks



Related Tutorials/Questions & Answers:
send multiple textbox vaues in to an jsp form to store them in a DB table
send multiple textbox vaues in to an jsp form to store them in a DB table  Hi sir... I am not getting how can i send the multiple input text box values in to an jsp file with additional values to store those values
to store form vaues in database - JDBC
to store form vaues in database  sir i have created one form with two fields. 1.name 2.father name if we enter the values to these fields... :   Navigating in a Database Table Welcome
Advertisements
How to insert data from a combobox and textbox values into DB using JSP?
How to insert data from a combobox and textbox values into DB using JSP?  hi, How to insert a comb-box and a text box values in to DB using JSP? @DB:student; @table:stu_info; Combobox values:(class1,class2,class3); textbox1
get value from multiple textbox in jsp
get value from multiple textbox in jsp  how to get multiple textbox value in another jsp? If i using the following code <%for(int i=0;i<3;i++) {%> <td>name<input type="text" class="name" id="name">
JSP textbox autopopulation on basis of SQL table values
JSP textbox autopopulation on basis of SQL table values  Hi, I need... table is created in MySQL DB: Problem type Status Responsible LEGAL CONTROL NEW ABC LEGAL Dept PENDING PQR There are 2 list box on JSP , one
Extract xml to store into db - JSP-Servlet
Extract xml to store into db  Hi all, I need to get the data from the xml file and store it onto the database. Is there anyway of doing this? thanks
how to send mail with multiple attachments in jsp
how to send mail with multiple attachments in jsp  how to send mail with multiple attachments in java script
How to store multiple images in folder and images path in database at a time using jsp?
How to store multiple images in folder and images path in database at a time using jsp?  I wanna browse multiple images in one form and store them in one folder and their path into datrabase
multiple form with multiple function in 1 jsp - JSP-Servlet
multiple form with multiple function in 1 jsp  Hi, I'm using Netbean... in triggering my jsp with 2 forms as 1 for registration and 1 for log in. I need to trigger each form to call several function when user click buttons of these forms
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?  HELLO SIR, CAN ANYONE HELP ME OUT HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILES,IF I ENTER 4 EMPLOYEE DETAILS(NAME,ID,SALARY,EMAIL) ALL THE DETAILS OF 4
Getting mysql table in textbox
Getting mysql table in textbox  how to get mysql table values into textbox in java using ajax and servlets
jsp or sevlet and html form to send picture to database - JSP-Servlet
jsp or sevlet and html form to send picture to database  Hello guys... that contains his picture to database. What I need are html page for the form that will browse for the picture, jsp or servlet that the info from html will go
i want to store dynamic number of value on one jsp and retrieve them on other.
i want to store dynamic number of value on one jsp and retrieve them on other.  in my problem, i want to run a query from database.then while in loop... are being created in result loop. i.e while(rs.next){}. i want to store
Need Help-How to store input parameter in DB through Java Bean - JSP-Servlet
Need Help-How to store input parameter in DB through Java Bean  Hello... are not store in Ms-Access. I store the input parameter through Standard Action . jsp:useBean call a property IssueData. this property exist in SimpleBean.java
how to store data in other table using servlet and jsp
how to store data in other table using servlet and jsp  pls can anyone tell how to store data in other table using servlet and jsp and want to display that data too.and the data in first table must be same.pls help
store dynamic generated textbox value into database
store dynamic generated textbox value into database  sir, how do i store dynamically generated textbox value into the database thanks in advance
JSP,DB
JSP,DB  How to store the resultset of a query in a hashtable n retrive it into a jsp textfield!!!!!! datatable Label value id applno 13434323 123 batchno 4334 123 The database table is similar
store pagination form fields - Struts
store pagination form fields   hi,iam working online exams project . my intention is to save data that has been asnwered by client/student into db table. here iam using pagination for questions to be displayed to client
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE.... 1)register.jsp <html> <form method="post" action="insert.jsp"> <
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE.... 1)register.jsp <html> <form method="post" action="insert.jsp"> <
how to use one form out of multiple form from one jsp to another jsp
how to use one form out of multiple form from one jsp to another jsp  ... a .jsp( say abc.jsp) file which contains multiple Action form.I am required to add one form from abc.jsp as it is to another .jsp(say def.jsp).Your advise
Multiple form in Jsp
Multiple form in Jsp       In this section, we have developed an Multiple form...;userform.jsp") to create the multiple form. <!DOCTYPE HTML PUBLIC
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript  when click on the next... to display previous 10records. Database Query like this: Select * from table
Jsp-delete checked checkboxes and display UNCHECKED checkboxes in table as well as in store that unchecked checkboxes in ARRAYLIST
Jsp-delete checked checkboxes and display UNCHECKED checkboxes in table as well as in store that unchecked checkboxes in ARRAYLIST  I have a table... think you want to show the records of a table in a form and the checked records
multiple submits, single form.
multiple submits, single form.  is it possible to use multiple submit buttons in a single form?   Thank you
after entering details in reg page,n enter the submit button,how can v store the data in db, n hw can v retrive the data frm db in jsp
the submit button,how can v store the data in db, n hw can v retrive the data frm...after entering details in reg page,n enter the submit button,how can v store the data in db, n hw can v retrive the data frm db in jsp  i ve creted
how to text send from list to textbox - Swing AWT
how to text send from list to textbox  dear sir/madam I whant to send text from list to textbox. plz give me solution for this problem.  ... the technology you have used like JSP/Servlet/Struts/JSF etc.. Thanks
how to featch data form db?
how to featch data form db?  how to featch data form db?   ...;/editor-fold> }   jsp <%-- Document : TCSBLUE Created...; </a> <div class="search" <form class
store form data into word document
store form data into word document  i want form page data, ex username phone number.. to store it in a word document file
javascript for textbox - JSP-Servlet
javascript for textbox  Dear sir , How to write a javascript for a textbox ?.I am doing a delet operation.When i clik on a particular record...:8080/examples/jsp/deleteuser.jsp?id='+id,'mywindow','width=500, height=350,toolbar
Joining Multiple table in Hibernate
Joining Multiple table in Hibernate  Hi everyone, I'm new... queries to them. Tables names are TbPessoa (one) and TbTelefone(many... (using System.out.println) the query results. I've been using (just for one table
JSP,DB,SERVLET
JSP,DB,SERVLET  I have a jsp page called page1.jsp with 3 text fields name,phone ,city.i populated these datas into a database table through servlet (page1servlet.java) and bean(page1bean.java).I have another jsp page(display.jsp
Handling multiple buttons in HTML Form
Handling multiple buttons in HTML Form  How to handle Handling multiple buttons in HTML Form
Store image from html img tag into mysql db using java
Store image from html img tag into mysql db using java  Hi. How to get the image displayed in the < img > tag of HTML and store it in the mysql database using java? Thanks in advance
JSP,DB,SERVLET
JSP,DB,SERVLET  I have a jsp page with 3 text fields name,age ,city.i populated these datas into a database table.I have another jsp page with 4 fields name, city , age and phone.Once the user enter the name, city and age should
to upload a table from DB to the same html page
to upload a table from DB to the same html page  how to make this booklist table to be opened in the same html page itself using a third frame
javascript for textbox - JSP-Servlet
('http://localhost:8080/examples/jsp/deleteuser.jsp?id='+id+'&&reas='+reason
JSP,DB,SERVLET
JSP,DB,SERVLET  hi thank you for your reply.With this code i can insert the data successfully into database but once i give submit button... and city are not automatically fetched......can u help me?????? And can u send me
java program to read multiple files from a directory and display them on a jframe
java program to read multiple files from a directory and display them on a jframe  hi guys i want to write a java program that will read all files in a directory and display them one by on on a jframe on jpanel with specific key
jsp form
jsp form  hi sir, one got one got in jsp form after entering the data into the form the data is not saving in the database i will send you code of two forms if dnt understand my problem
URGENT: Export Table in Oracle db to CSV file
URGENT: Export Table in Oracle db to CSV file  Hi, Could you basically help me by providing a program in Java. I want a program to connect and export a table in the oracle database to a folder in my local harddrive. Thankyou
JSP WITH MULTIPLE FORMS
JSP WITH MULTIPLE FORMS     ... in single jsp page. Most of the times people need to use multiple forms...; these have been used to navigate specific JSP page. To identify which form
How to create textbox on combo value selection using javacsript in jsp?
How to create textbox on combo value selection using javacsript in jsp?  dynamically create textbox on combo value selection. when select multiple values then create multiple textboxes
JSP,DB,SERVLET
JSP,DB,SERVLET  hi thank you for your reply.With this code i can insert the data successfully into database but In ajax.jsp once i give the name;;;age and city are not automatically fetched......instead sumthing get filled
how to get multiple hyperlink values from a table column to another jsp file?
how to get multiple hyperlink values from a table column to another jsp file?  dear sir: this is what i'm trying to do, i have 3 JSP files. first... for the user string in the database, as a result a table will come up with 3 columns itemid
reading multiple files from a directory and writing them into a single file
reading multiple files from a directory and writing them into a single file   i have done the following code but the every time i write to the single... this: /*this program reads multiple files * from a single directory. */ package elite.tech.com
To store date - JSP-Servlet
format only. If it is possible to convert from integer to date send me the method. And send the actual query to store the date also. With lots of thankzs...To store date  Hai friends, I want the format to store
How to get data from DB in to Text box by using Jsp & Ajax
How to get data from DB in to Text box by using Jsp & Ajax   I want to get the data from database in to text box in a jsp page by using Ajax. If I enter the letter A in the textbox it should show only those values which starts
Html form using JavaScript to display the table content
Html form using JavaScript to display the table content  HI There, Greetings, I am new to this java and I need your assistance. I have created... extract the single xml and store it in a SQL server db. I have done these part. Now I
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir I am... ,if they are confirmed to delete the i have to take a reason for deleting a textbox as to come if press ok then delete the file then i have to store that reason in a data base so
 

 

 

DMCA.com