<%@ page import="java.sql.*"%>
<%String fname=request.getParameter("name");
String lname=request.getParameter("last");
String id= request.getParameter("id");
String pass=request.getParameter("password");
String pass1=request.getParameter("passcon");
String month=request.getParameter("Months");
String date=request.getParameter("date");
String year=request.getParameter("year");
String gender=request.getParameter("gender");
String country=request.getParameter("country");
%>
<%=try
{
Connection c=null;
Statement st= null;
DriverManager dm=null;
String pass="";
String user="";
PreparedStatement pt=null;
String url="Jdbc:Odbc:jaggi";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c=dm.getConnection(user,pass,url);
if(pass.equals(pass1))
{
pt=c.prepareStatement(insert into Registration values(?,?,?,?,?,?,?,?,?));
pt.setString(1,fname);
pt.setString(2,lname);
pt.setString(3,id);
pt.setString(4,pass);
pt.setString(5,month);
pt.setString(6,date);
pt.setString(7,year);
pt.setString(8,gender);
pt.setString(9,country);
pt.executeUpdate();
application.setAttribute("name",fname);
application.setAttribute("ID",id);
RequestDispatcher r=application.getRequestDispatcher("/Welcome.jsp");
if(pt.equals(true))
{
r.forward(request,response);
}
else
{
//JOptionPane.showMessageDialog(null,"Your Registration Failed plz try again");
}
}
else
{
//JOptionPane.showMessageDialog(null, "Please enter Correct Password");
}
c.close();
}
catch(Exception e)
{
//JOptionPane.showMessageDialog(null,e);
}%>
Above code is for JSP its not running please tell me the error and how to run this file.
And the html file for above code is given below
<html>
<body bgcolor="gray" text="white">
<form action="http://localhost:7001/Jaggi/Registration.jsp" >
<h1 align="center">Registration Form</h1>
<style type="text/html">
h1 {color:blue}
</style>
<fieldset>
First name
                      :<input type="text" name="first">
.     Last name
        :<input type="text" name="last">
<br><br>
Choose your Yahoo ID
  :<input type="text" name="id">
.  <input type="button" name="check" value="Check availability" >
<br><br>
Choose Password
          :<input type="password" name="password">
<br><br>
Confirm your Password
  :<input type="password" name="passcon"><br><br>
Date of Birth
                  :<select size="1" name="Months"><option value= Month selected>Month</option><option
value=January >january</option> <option value="feburay">feburay</option>
<option value="March">march</option> <option value="April">April</option> <option
value=may>may</option> <option value="june">june</option> <option
value=" july">july</option> <option value=" Augst">Augst</option><option value= "September">September</option>
<option value= "October">October</option> <option value= "November">November</option>
<option value="December">December</option>
</select>
<input type="text" name="date"value= "dd" size=3>
<input type="text" name="year" value =" yyyy"size=5><br><br>
Gender
                          :<select size="1" name="gender"><option value=select selected>select</option>
<option value="Male">Male</option>
<option value="Female">Female</option></select><br><br>
Country
                        :
<select size=1 name="country"><option value=Select selected>Select</option>
<option value="India">India</option>
<option value= "United States">United States</option>
<option value= "United Kingdom">United Kingdom</option>
<option value= "Canada">Canada</option>
<option value= "Singapure">SingaPure</option>
<option value= "Malasiya">Malasiya</option>
<option value= "Australia">Australia</option>
<option value= "Suadia Arabia">Suadia Arabia</option>
<option value= "United Arab Emirates">United Arab Emirates</option>
<option value= "South Africa">South Africa</option>
<option value= "Phillipens">Phillipens</option>
<option value= "Pakistan">Pakistan</option>
<option value= "China">China</option>
<option value= "Japan">Japan</option>
<option value= "Italy">Italy</option></select><br><br>
Verify Your Registration
:
<input type="text" name="verify"style=" font-size: 20px;" size=15 >
<LABEL FOR="verifycode">
<--Enter the code in the image here
</LABEL>
     
<input type="text" style="background-image:url([url]http://register.rediff.com/register/include/display_image.php);[/url] background-repeat: no-repeat; background-position: center center; font-size: 19px;"size=0 />
<br><br>
<input type="submit" name="register" value="Register Me"align="center">
<input type="button" name="cancel" value="Cancle" align="center">
</fieldset>
</form>
</body>
</html>