<%@ page import="java.sql.*"%>
<html>
<body bgcolor="pink">
<%
String user=request.getParameter("us");
String pass=request.getParameter("pa");
String a=request.getParameter("na");
String a1=request.getParameter("no");
String a2=request.getParameter("el");
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:Data405");
stmt=con.createStatement( );
stmt.executeUpdate("Insert Into stud(username,password,nam,nos,elg)
Values('"+user+"','"+pass+"','"+a+"','"+a1+"','"+a2+"')");
out.println("File inserted");
}
catch(Exception e)
{
out.println("error");
}
con.close();
%>
<a href="http://localhost:8080/maya/login1.jsp">go back</a>
</body>
</html>
I can display the details but can't insert through code.