hai iam nireekshan
i have davalep the one Neu User Enter form in html .In this form Fillap After SUBMIB
After Useing MS-Access in THis create New User ENtrey Fields table
and i am using TomCat Server and write jsp code and my database name NIREE
Table Name New User Entrey
plse see it
<%@ page import="java.sql.*" %>
<%@ page import ="java.servlet.*" %>
<%
String vname=request.getParameter("name");
int vage=Integer.parseInt("age");
int vweight=Integer.parseInt("weight");
int vheight=Integer.parseInt("height");
String vsex=request.getParameter("sex");
String vdiet=request.getParameter("diet");
String vsmoker=request.getParameter("smoker");
String valcohol=request.getParameter("alcohol");
String vlifestyle=request.getParameter("lifestyle");
String vemail=request.getParameter("email");
String vany medical Problem=request.getParameter("any medical Problem");
String vcountry=request.getParameter("country");
String vcity=request.getParameter("city");
String vyour Present Diet=request.getParameter("your Present Diet");
//code to connect to the database
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:karani","","");
DRIVER={Microsoft Access Driver(*.mdb)};DBQ=Database.mdb");
Statement st=con.createStatement();
PreparedStatement pst;
pst=con.prepareStatement("insert into New User Registration values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
pst.setString(1,vname);
pst.setInt(2,vage);
pst.setInt(3,vweight);
pst.setInt(4,vheight);
pst.setString(5,vsex);
pst.setString(6,vdiet);
pst.setString(7,vsmoker);
pst.setString(8,valcohol);
pst.setString(9,vlifestyle);
pst.setString(10,vemail);
pst.setString(11,vany medical Problem);
pst.setString(12,vcountry);
pst.setString(13,vcity);
pst.setString(14,vyuor Present Diet);
int i=pst.executeUpdate();
con.close();
}
%>