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

 
 


Vinay KP
send multiple textbox vaues in to an jsp form to store them in a DB table
1 Answer(s)      2 years and 6 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...

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 Pages:
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
db
;title>Insert title here</title> <h2><center>TELECOM STORE...;/p></td> </tr> </table> <table align... PRODUCT MODEL</center></h2> </head> <body> <form name
db
;title>Insert title here</title> <h2><center>TELECOM STORE...;/p></td> </tr> </table> <table align... PRODUCT MODEL</center></h2> </head> <body> <form name
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
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
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
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
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
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,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
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
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
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
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
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
Java Multiple Insert Query
and in the other table we will store the multiple selected value of dropdown list... value from dropdown list and then to store them into the table. To get... will select the multiple list from this dropdown list and then we will store all
Servlet Response Send Redirect - JSP-Servlet
Servlet Response Send Redirect  Hi, Thank you for your previous... to be able to do search on the Mysql table based on more than one column instead of one... or last name. The result gets populated in the search table, user clicks
retriving data from sql server using jsp code and placing them in text fields of html code
in the addclients table. can anyone plese send me the jsp code to retrieve...retriving data from sql server using jsp code and placing them in text fields... server 2008 using a jsp file and place the values in the text fields of a html file
Uploading Multiple Files Using Jsp
Uploading Multiple Files Using Jsp  ... to understand how you can upload multiple files by using the Jsp. We should avoid to use Jsp for performing any logic, as Jsp is mainly used for the presentation
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row
or .txt) file and get the values from that file and store them into database table in multiple rows(which means one value for one row). eg: my file containes...how to read the values for text and csv files and store those values
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
how to featch data form db?
how to featch data form db?  how to featch data form db?   /* * To change this template, choose Tools | Templates * and open the template...;/editor-fold> }   jsp <%-- Document : TCSBLUE Created
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
code for jsp to db connection using jdbc
code for jsp to db connection using jdbc  please send me the code   Hi Friend, Try the following code: 1)form.html: <html> <form method="post" action="http://localhost:8080/examples/jsp/insert.jsp"> <
How to create d db for upload files using bolb i m followin dat upload file in db tutorial
How to create d db for upload files using bolb i m followin dat upload file in db tutorial  How to create d db for upload files using bolb i m followin dat upload file in db tutorial   Create a table named 'file
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 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
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
Insert Image in DB through Servlet - JSP-Servlet
Insert Image in DB through Servlet  Dear Sir, My previous Query... of apache-tomact image.I want to add an image which store in my drive. And My... it then use the code inside Ohterwise send ur mailid Thanks' Rajanikant
sample jsp-servlet-service-db program
sample jsp-servlet-service-db program  <%@ page language="java...!"); } </script> </head> <body bgcolor=silver> <form...;table border="0" cellpadding="0" cellspacing="0"> <tr> <td>
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
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
listbox and textbox validations
listbox and textbox validations  hi, any one please tell me how...   Please visit the following link: http://www.roseindia.net/jsp/user-registration-form-using-jsp.shtml
Getting mysql table in textbox
Getting mysql table in textbox  how to get mysql table values into textbox in java using ajax and servlets
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
PHP form
form and update them to respective coloumn... Please any one help mo out please...PHP form  Hi Sir/Madam, I am developing an attendance form using php, which displays the name and ID of a Employees which are fetched from Db and I
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
How to pass multiple values from a servlet to JSP?
How to pass multiple values from a servlet to JSP?  hi, I want to pass multiple values form a servlet to JSP. Hw do i do that? I am able to send one value at a time without any prb, but I am unable to carry multiple (from two
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
store
store  hi i want store some information in my program and use them in other method. what shoud i do
Sql Server 2008 with textbox
Sql Server 2008 with textbox  **Hi, I tried to insert into DB using textbox in a form using vb by visual studio 2010 but its always catch an error [Cannot open database "4" requested by the login. The login failed. Login failed
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
Multiple file Uploading - JSP-Servlet
Multiple file Uploading   Hello everyone I am using jsp and my IDE is eclipse and back end is ms sql server i am trying to upload multiple... reply soon r shal be screwed out to core hell help me its very urgent send me
for store data in data base - JSP-Servlet
.. and on 3rd form i use submit button... data of form 1 and 2 can also be store in table along with 3 form.. how can i do it... i use sql server2000  Hi...for store data in data base  i want to a job site, in this site user
how to send emails to many using jsp by connecting to ms access dabase.
how to send emails to many using jsp by connecting to ms access dabase.  Hi. I am trying to send multiple emails and the email ids are stored in a table in a msaccess database.I am using jsp for this.And finally there should
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 store image upload path to mssql database
;title>JSP Page</title> </head> <body> <FORM ENCTYPE="multipart/form-data" ACTION="image2" METHOD=POST> <table border...how to store image upload path to mssql database  hi there!!, i need
how to store image upload path to mssql database
;title>JSP Page</title> </head> <body> <FORM ENCTYPE="multipart/form-data" ACTION="image2" METHOD=POST> <table border...how to store image upload path to mssql database  hi there!!, i need

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.