Skip to Main Content

Is there any error in this jsp file...??

1002778Apr 12 2013 — edited Apr 16 2013
aftr database connection query is not running....



<%@page import="java.sql.*"%>
<%@page import="java.io.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body bgcolor="#CEA69F">

<%
try{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");


Connection conn=DriverManager.getConnection("jdbc:odbc:signupdsn");

Statement stmt=conn.createStatement();
out.write("<face='Jokerman'>\nYou are successfully Connected to database, ");

String dom=request.getParameter("dofm");

int age2=Integer.parseInt(request.getParameter("age2"));

String dob2=request.getParameter("dob2");

int age1=Integer.parseInt(request.getParameter("age1"));

String dob1=request.getParameter("dob1");

int w_fage=Integer.parseInt(request.getParameter("w_fage"));

int w_mage=Integer.parseInt(request.getParameter("w_mage"));

int h_fage=Integer.parseInt(request.getParameter("h_fage"));

int h_mage=Integer.parseInt(request.getParameter("h_mage"));

int w1age=Integer.parseInt(request.getParameter("w1age"));

int w2age=Integer.parseInt(request.getParameter("w2age"));

String husname=request.getParameter("hname");

String reli2=request.getParameter("rel2");

String mar_s2=request.getParameter("st2");

String occ2=request.getParameter("occ2");

String readd2=request.getParameter("add2");

String id2=request.getParameter("id2");

String h_fname=request.getParameter("h_fname");

String h_fadd=request.getParameter("h_fadd");

String h_mname=request.getParameter("h_mname");

String h_madd=request.getParameter("h_madd");

String wname=request.getParameter("wname");

String mar_s1=request.getParameter("st1");

String occ1=request.getParameter("occ1");


String readd1=request.getParameter("add1");


String id1=request.getParameter("id1");

String w_fname=request.getParameter("w_fname");

String w_fadd=request.getParameter("w_fadd");

String w_mname=request.getParameter("w_mname");

String w_madd=request.getParameter("w_madd");

String priestn=request.getParameter("priestn");

String priestadd=request.getParameter("priestadd");

String strname=request.getParameter("street");

String vill=request.getParameter("village");

String dis=request.getParameter("district");

String w1name=request.getParameter("w1name");

String w1add=request.getParameter("w1add");

String w2name=request.getParameter("w2name");

String w2add=request.getParameter("w2add");

String reli1=request.getParameter("rel1");

stmt.executeUpdate("insert into marraige(hname,rel2,dob1,dob2,dofm,st2,occ2,add2,id2,h_fname,h_fadd,h_mname,h_madd,wname,rel1,st1,occ1,add1,id1,w_fname,w_fadd,w_mname,w_madd,priestn,priestadd,street,village,district,w1name,w1add,w2name,w2add,age2,age1,w_fage,w_mage,h_fage,h_mage,w1age,w2age) values('"+husname+"','"+reli2+"','"+dob1+"','"+dob2+"','"+dom+"','"+mar_s2+"','"+occ2+"','"+readd2+"','"+id2+"','"+h_fname+"','"+h_fadd+"','"+h_mname+"','"+h_madd+"','"+wname+"','"+reli1+"','"+mar_s1+"','"+occ1+"','"+readd1+"','"+id1+"','"+w_fname+"','"+w_fadd+"','"+w_mname+"','"+w_madd+"','"+priestn+"','"+priestadd+"','"+strname+"','"+vill+"','"+dis+"','"+w1name+"','"+w1add+"','"+w2name+"','"+w2add+"','"+age2+"','"+age1+"','"+w_fage+"','"+w_mage+"','"+h_fage+"','"+h_mage+"','"+w1age+"','"+w2age+"')");

out.write("\n Data Inserted");

out.write("<center> <br>please click here to continue<a href='loginh.jsp'>login</a>");


}
catch(Exception e)

{
System.out.print(e);
}

%>

Edited by: 999775 on Apr 12, 2013 8:44 AM
Comments
Post Details
Added on Apr 12 2013
3 comments
1,943 views