Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

create a one web page

Ads

 
 

Share on Google+Share on Google+

rajasekar
create a one web page
1 Answer(s)      6 years and a month ago
Posted in : HTML

create a one web page with stored values in a database..

Ads
View Answers

July 11, 2011 at 12:11 PM


1)form.html:

<html>
<form method="post" action="http://localhost:8080/examples/jsp/insert.jsp">
<table>
<tr><td>First Name:</td><td><input type="text" name="fname"></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lname"></td></tr>
<tr><td>Email:</td><td><input type="text" name="email"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
<tr><td>Confirm Password:</td><td><input type="password" name="cpass"></td></tr>
<tr><td>Date Of Birth</td><td><input type="text" name="dob"></td></tr>
<tr><td>Age:</td><td><input type="text" name="age"></td></tr>
<tr><td>Gender</td><td><input type="text" name="gender"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"></td></tr>
<tr><td>Country</td><td><input type="text" name="country"></td></tr>
<tr><td>State:</td><td><input type="text" name="state"></td></tr>
<tr><td>City</td><td><input type="text" name="city"></td></tr>
<tr><td>Telephone No:</td><td><input type="text" name="tno"></td></tr>
<tr><td>Mobile:</td><td><input type="text" name="mobile"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)insert.jsp:

<[email protected] import="java.sql.*,java.util.*"%>
<table>
<%
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String email=request.getParameter("email");
String pass=request.getParameter("pass");
String cpass=request.getParameter("cpass");
String dob=request.getParameter("dob");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String address=request.getParameter("address");
String country=request.getParameter("country");
String state=request.getParameter("state");
String city=request.getParameter("city");
int telephone=Integer.parseInt(request.getParameter("tno"));
int mobile=Integer.parseInt(request.getParameter("mobile"));

        try{
         Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/roseindia", "root", "root");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into student(firstname,lastname,email,pass,confirm_pass,dob,age,gender,address,country,state,city,telephone,mobile) values('"+fname+"','"+lname+"','"+email+"','"+pass+"','"+cpass+"','"+dob+"',"+age+",'"+gender+"','"+address+"','"+country+"','"+state+"','"+city+"',"+telephone+","+mobile+")");
        out.println("Data is successfully inserted!");
        }
        catch(Exception e){
        System.out.print(e);
        e.printStackTrace();
        }

Ads









Related Tutorials/Questions & Answers:
create a one web page
create a one web page  create a one web page with stored values in a database
how to create web page on jsp?
how to create web page on jsp?  how to create web page on jsp
Advertisements
at one click to reveal the paricular part of a web page
at one click to reveal the paricular part of a web page  How to reveal the hidden code of particular part of a web page? Note:That hidden code coming from database(in while loop
Create Web Page with jsp
Web Page with jsp       In this example we will show you how to create first web page on tomcat.... For this we will create a simple dynamic JSP page with java.util.Date class (<
May I know how to create a web page?
May I know how to create a web page?  can u suggest me how to start
WEB PAGE
WEB PAGE  How To Create A Simple web Page Of a gmail using applet
how to create web aplli
how to create web aplli  how to Create a web application using any technology to display 10 most relevant tweets from Twitter in real-time for the keyword "@cldmgc
how to create web aplli
how to create web aplli  how to Create a web application using any technology to display 10 most relevant tweets from Twitter in real-time for the keyword "@cldmgc
web page
web page  1.Create a web page with the following using HTML i) To embed an image map in a web page ii) To fix the hot spots iii) Show all the related information when the hot spots are clicked
Web Page
Web Page    Use any programming language or package to create a Project 2 .The Main menu should only be displayed, if the user is valid and uses... or package to create a basic User Interface that will be able to accept multi-level menu
Two Pagination in one page
Two Pagination in one page  hai friends any one help me. how do u make two pagination script in same page i'm used some ajax coding one pagination script is working but another pagination is not working please help me urgent
one to many video chatting in web application
one to many video chatting in web application  Hi all....I am developing a web application,where video chatting is its one of the main feature.Can anybody tell me which technology to be used.Currently i am using Jsp and servlet
create a folder in jsp page
create a folder in jsp page  i want to create a folder in jsp page And it can be delete aslo
create web application using maven
In this section, you will learn to create a web application using maven
Easily create JSP page
Easily create JSP page  Hi, How I can easily create JSP page? Where... Pages and its easy to create a simple JSP page. Check the tutorial: How to Create JSP Page? Thanks
new web page
new web page  I am creating a new web page for an user to sign up....how to give error messages if an user has not entered some fields(it can be one or many)... An example could be your webpage where you have indicated in red
Web page example
Web page example  Hi, How to make sample web page? Thanks   Hi, If you are aware of HTML then you can write simple web page for your... any HTML editor to create website pages. Thanks
parser xml one page to another
parser xml one page to another  parser xml one page to another
connect a web page to a database
connect a web page to a database  how to connect a web page to a database
Create Security header in web services - WebSevices
Create Security header in web services  How we can create a security header in the web services.Please provide me the code if anyone available thanks in advance
how to create SOAP based web service in java?
how to create SOAP based web service in java?  Hi, I want to create sample SOAP web-service based application using jsp/servlet. Please help me
how to create a xml page
how to create a xml page  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...;head> <meta name="Description" content="Information architecture, Web Design, Web Standards." /> <meta name="Keywords" content="your, keywords
php web page capture
php web page capture  How to capture the history of a web page using PHP
how to dynamically create one file with any example in php
how to dynamically create one file with any example in php  how to dynamically create one file with any example in php
setting web page size
setting web page size  How to set the webpage size in Java
web page design
web page design  Great Applianz Ltd. was established in 1985, in New.... The website should provide the following functionality: A Welcome page that gives the user a brief introduction about the company. This page should display the name
create main page
create main page  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@page import="java.sql.*"%> <%@page import="java.util.*"%> <%@ page session="true
How to create web application using maven in Eclipse?
How to create web application using maven in Eclipse?  I have to create the web project in Maven using the Eclipse IDE. Since Eclipse is very useful.... Now want to use the Maven in the Eclipse. I don'w know how to create web
map on web page
map on web page   i want to insert an area map in my web page how can i do it ? please answer me soon. Its urgent
create login java web service - WebSevices
create login java web service  Hi, I am kind of newb in java web service development , i want to write a simple web service application that client... in this web site, but it seems different. Thanks
how to add web cam in web page
how to add web cam in web page  how do i embed my webcam in web page. code for embedding web cam in web page