create a one web page

create a one web page

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

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:

<%@page 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();
        }









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
create .tar.gz in one command
create .tar.gz in one command  Hi, I have a big file on Linux server and I want to crate the tar.gz file so that size can be reduced and taken for backup. I want the command to that i can create .tar.gz in one command. Give me
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
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  How To Create A Simple web Page Of a gmail using applet
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
parser xml one page to another
parser xml one page to another  parser xml one page to another
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
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 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 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
How to fetch entries/values from database to a jsp page one by one?
How to fetch entries/values from database to a jsp page one by one?  I have a table in Microsoft SQL server Management Studio with two columns title and data and each column has 10 enteries. I have a jsp page on which i want
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
html program to create home page
html program to create home page  html program to create home page
Create HTML page using java
Create HTML page using java   Hi, I need to create an html page to export some information. Currently, by using java, i've exported information to excel. But now, I would like to view it in HTML instead of excel. Is there any
how to create a login page and registration page?
how to create a login page and registration page?  hellow, pls tell me the code for how we can create a login page and registration page and how we can store the info in database.only in advance java as jsp
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
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
connect a web page to a database
connect a web page to a database  how to connect a web page to a database
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
to bring checked data from one page to another
to bring checked data from one page to another  thanks for your help... there is one jsp page , on it there is a link, on click of which it is opening second jsp page which is connected with servlet at the back and through which i am
Web page example
Web page example  Hi, How to make sample web page? Thanks... are aware of HTML then you can write simple web page for your website. You have... to create website pages. (adsbygoogle = window.adsbygoogle
php web page capture
php web page capture  How to capture the history of a web page using PHP
How to create one xml file from existing xml file's body?
How to create one xml file from existing xml file's body?  Hi, i'm working with content optimization system.I want to know how we can take all data from an xml doc's body to develope another xml with that content.I'm using JDOm
Web Page Transaction
Web Page Transaction  Hello sir, i want to add an Effective page transaction when i go to my home page to other page in js...plllzzz help me...rppy soon
insert , edit , and delete button in one jsp page
insert , edit , and delete button in one jsp page  hello I want to ask about the way of creating a jsp page contains insert , edit , and delete buttons and manipulate data in database directly. any help please or hints
setting web page size
setting web page size  How to set the webpage size in Java
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
how to do two database tables in one page?
how to do two database tables in one page?  dear all: i want to show these two database tables in one page. one table on the left (dbtable.jsp...*** <%@page import="java.sql.*"%> <html> <table border="1"> <
calling one jsp from another jsp page
calling one jsp from another jsp page  need coding for calling one jsp from another jsp including the xml file.Its urgent
calling one jap page from another jsp page
calling one jap page from another jsp page  i created a button in one jsp page i need to call another jsp page as an action to that button. so how can i call.. plz any one explain. its urgent
web page access
web page access  I was store project in server and i will open that project file in client side add="http://server:8080/project..." this is very..." and project code = "Java Server Page" "HOW TO WRITE CODE CLIENT ACCESS SERVER
Web Page preprocessing
Web Page preprocessing  Java code to extract unique words from an XML file( has different web pages embedded inside <DOCNo>.. ) and display the unique set of words for each document. Say for example, the XML file has 49
web page reading in java
web page reading in java  i wanna read webpage in that i want to get the data from the particular tags like (,) and store into the data base...... can any body tell me the solution? plz urgnt. thanks and regards, jasti  
Create dynamic page through JSP
how to create dynamic page. This code shows one by one record of student from... Create dynamic page through JSP..., application fetch next record from database. Create a database :  Before
How to Create JSP Page
How to Create JSP Page       In this section we will show you how you can create JSP page and then test... can be used. In this example I will show you how to create a simple JSP page
create web application using maven
In this section, you will learn to create a web application using maven
validation web page
validation web page  vivek i want to crate a webpage with specfic email id and password to that webpage . using jsp & servlets   Hi Friend, Try the following code:ADS_TO_REPLACE_1 <html> <script>
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 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
how to create a jsp page like gmail inbox page
how to create a jsp page like gmail inbox page  in my struts project i need to create a page like gmail inbox page..........how can i create this? help me some one
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
To create an web application using netbeans IDE
To create an web application using netbeans IDE  Hi, I'm a beginner in java and I have created an jsp code for entering the username password details,and an submit button.My requirement is when i click on submit button my

Ads