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



Home Answers Viewqa JDBC web form(html) with jdbc

Have Programming Question? Ask it here!
 
 
 


Ramya Lakshmanan
web form(html) with jdbc
1 Answer(s)      3 years and 6 months ago
Posted in : JDBC


need a example coding to develop a web form of data with jdbc


Advertisement
View Answers

January 24, 2011 at 1:06 PM


Hi Friend,

Try the following code:

1)form.html:

<html>
<form method="post" action="http://localhost:8080/examples/jsp/insertdata.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)insertdata.jsp:

<%@page import="java.sql.*"%>
<%
String name=request.getParameter("name");
String address=request.getParameter("address");
try{
Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into data(name, address) values('"+name+"','"+address+"')");
         con.close();
         out.println("Data is successfully inserted into database.");
}
catch(Exception e){
    System.out.println(e);

}
         %>

Thanks



Related Tutorials/Questions & Answers:
web form(html) with jdbc
web form(html) with jdbc  need a example coding to develop a web form of data with jdbc   Hi Friend, Try the following code: 1)form.html: <html> <form method="post" action="http://localhost:8080/examples/jsp
HTML Form data into .CSV?
HTML Form data into .CSV?  how to store data from html form to csvfile in java
Advertisements
HTML form examples
HTML form examples  Hi, How to create a simple data entry form in HTML and use JavaScript to validate the same. Can anyone share html form examples code? Thanks   Hi, Please see the HTML form example page. Thanks
Registration Form in HTML
Registration Form in HTML  User Registration Form in HTML - i wanted to design a user registration form in HTML. So, Can anyone please guide me or give me a peace of code to design a user registration form in HTML. Thanks
html - JDBC
html  How to insert a new column into HTML (or jsp) table dynamically? i have to print a table of html depending on number of subjects (where subjects are retrieved from Oracle)? I retrieved values from Oracle through
HTML - JDBC
HTML  I created on html page with two comboboxes. when ever i select one value in first combobox then immediately in the second combo box values... combobox. please send me code of html   Hi Friend, To do
HTML to php form
HTML to php form  Hi, How I can submit the HTML form data to PHP Script? Give me example code. Thanks   Hi, Please see the following tutorials: PHP Form PHP email form Thanks
HTML -- form tag.
HTML -- form tag. Description : HTML provides a form tag. It takes user... within form tag. Code : <!DOCTYPE html PUBLIC "-//W3C//DTD... language</title> </head> <body> <h1>HTML form tag
html form - Java Beginners
html form  Hi, I wnt to design a form with more than one action in submit button.thanks. regards, sakthi  Hi friend, You specify your main requirement of form with more then one action. Thanks
HTML form - Java Beginners
HTML form   Hi, thank u for fast reply. I have two forms (form1 and form 2)with several fields in html. When i click the submit button, it validates all fields then moves to form2. i have a problem with form navigation. i
HTML Form Validation example
HTML Form Validation example  Can anyone guide me how to validate the user name and password field in HTML using simple or JavaScript Validation. Thanks in advance!   <form method="post" onsubmit="return
Process HTML FORM data
Process HTML FORM data  Can a JSP page process HTML FORM data?   Yes. Preemptive termination of request processing on an error condition is a good way to maximize the throughput of a high-volume JSP engine. The trick
create html form as follows
create html form as follows  a form that contains two textboxes;one for your name and another for telephone number.telephone number should have exactly 10 digits starting with the digit '9' and name should not be left blank.add
create html form as follows
create html form as follows  a form that contains two textboxes;one for your name and another for telephone number.telephone number should have exactly 10 digits starting with the digit '9' and name should not be left blank.add
html form - Java Beginners
html form  Hi
html form - JSP-Servlet
html form  how to retrieve database value in dropdown list box placed in html form  Hi friend, Visit for more information. http://www.roseindia.net/jsp/ Thanks
convert this html form to jsp
convert this html form to jsp  <html> <head> <script...;/tr> <form name="VillageDetailsForm" action="AddVillage.jsp" method... includes html tags so you may change an extension. Please visit the following links
HTML form methods GET and POST
HTML form methods GET and POST  What is the difference between the HTML form methods GET and POST
dynamic web pages in html
dynamic web pages in html  How to create Dynamic web pages in HTML
Handling multiple buttons in HTML Form
Handling multiple buttons in HTML Form  How to handle Handling multiple buttons in HTML Form
Html form validation using jquery
Html form validation using jquery  Hi i am using form with html. Form elements like textbox, radio,checkbox,listbox i was used now how to validate the elements using submit jquery option
How to Open a File in HTML Form
How to Open a File in HTML Form  Hi, My question in that how could i open a file in HTML Form. Could any one suggest me the examples or online help... it. Otherwise take this examples and syntax that will show how to Open a file in HTML
HTML form validation using jquery
HTML form validation using jquery  Is there any way for validating html elements common under a class by giving its class name in jquery validation code..that means validating all elements by using its class name if those
HTML Post Form
HTML Post Form       The HTML process the submission of form in two different ways. In HTML... to send the form data in the form of message. The Post method in HTML is used
HTML form example
HTML form example In this section we will develop HTML form example and show you how to performance form validation using JavaScript. The HTML <form>...; HTML Form Example </title> <script type="text/javascript">
creating web page for form registration
creating web page for form registration  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives the Application
Copy text file in a HTML form.
Copy Text File in a HTML form For copying a text file from one source to other destination in HTML form, you will have to create a HTML form and call the form...;  Draw the HTML form <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Opening a file in a HTML form
Opening a file in a HTML form In this example, you will first see that a form... separately.  First create a HTML form and call the php action file to open...); } } ?> Making a HTML action form Draw a  table for browsing and browse
Visual web JSF - JDBC
Visual web JSF  can anybody tell me that how to insert data in mysql...; } RequestBean1.java String username; String url="jdbc:mysql://localhost... url="jdbc:mysql://localhost:3306/online research framework and library"; Plz
JSP to add details to a database from a HTML form.
JSP to add details to a database from a HTML form.  Hi I'm a second year CS student who has to use JSP to validate a HTML form and add the details..... Can anyone tell me what is wrong with my code? html code first
example of 1700 bir form using html
example of 1700 bir form using html   example of 1700 bir form using html i don't know how to start it... i'm confused on what would i do first and what would i use... :( please help me on this.... thank you in advance
JSP:HTML Form in-place Editing - JSP-Servlet
JSP:HTML Form in-place Editing  Hi, I want to thank the people... developer's needs. This is a follow up to the HTML Form in-place editing. The code works fine when I've incorporated it in my web application, its really
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 in textboxea the data must be stored in MYSQLdatabase please provide
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... want to write a Html JavaScript coding to display the content from database
JSP:HTML Form in-place Editing - JSP-Servlet
JSP:HTML Form in-place Editing  I have an HTML form (form #1) which... beans. Perhaps you guys are better aware of in-place html form editing than me...). Now my purpose is to re-populate the same customer form (form #1) based
Html form that auto fills outlook to,subject,body
Html form that auto fills outlook to,subject,body  I want to have... and body message. The user will fill out a form on-line when they click send... in it. Below is a working example. My problem is I can only get the form to work
how to write a jsp form using html
how to write a jsp form using html  hi, i have written the code as below... but it is showing error. please help me how to resolve it. .html file...; <body> <form method="POST" action="Form1.jsp"> EmployeeNo: <
web page for form registration to my department
web page for form registration to my department  I am creating web page for form registration to my department ..I have to Reprint the Application Form (i.e Download the PDf File from the Database ) , when the user gives
PHP HTML Form
PHP & HTML Form: In the current tutorial we will study about PHP and HTML form, we will see how to send HTML . We will combine one html file and PHP... a HTML form and send the data to PHP file get method. 
Uploading file in servlet from a html form
Uploading file in servlet from a html form  Sir, I want to upload a picture from my html file and save it to my database as BLOB,but what JAR should i use for this purpose i am really confused about.And also is it possible to do
PHP HTML Form Submit Button
Topic : HTML FORM SUBMIT BUTTON Part - 4 The another part which is important... of the tutorial then our Html form has covered the action and method attribute... in Html is used to submit form data to the page mentioned in the ACTION attribute
What is HTML web designing
What is HTML web designing Hypertext Mark-up Language (HTML) is the principal markup language for web..., lists, etc. HTML is written in the form of ‘tags’
to run html code in web browser - JSP-Servlet
to run html code in web browser  how to run jsp file which calls html file on web browser??  Hi Friend, Try the following code: 1)form.jsp: Enter Name: 2)welcome.html: Add Profile Edit
HTML code to servlet to database using jdbc
HTML code to servlet to database using jdbc  pls send me the code...: <html> <form method="post" action="http://localhost:8080/examples/Data...=req.getParameter("msg"); res.setContentType("text/html"); PrintWriter
HTML Code for registration form
HTML Code for registration form Here is an example of Registration form using HTML. Here a programmer can display as many "Text Field" as he/she wants... form their is a "ADD" button behnd which any desired link can be used. Once
HTML(Registration form) to Jsp to stored into MS ACCESS database
HTML(Registration form) to Jsp to stored into MS ACCESS database  i am sending one html file that contain 18 fields these are stored in ms-access... you for waiting that code. This is My Html page Link
how to update values of a html form into an excel table using java servlets?
how to update values of a html form into an excel table using java servlets?  i have written a java servlet program, which has a html form to be filled. after filling the form the servlet generates a receipt and the values should
how to load values of html form into an excel table using java servlet?
how to load values of html form into an excel table using java servlet?   i have written a java servlet program, which has a html form to be filled. after filling the form the servlet generates a receipt and the values should
How to retrieve array values from html form to jsp?
How to retrieve array values from html form to jsp?  Hi! I am... it into jsp. Means i just want to retrieve values from html form containing array..., To get an array values from the html form you can use the getParameterValues
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
 

 

 

DMCA.com