Hi can somebody help me i am new to developing. ADD the new record to the existing database table at the end of all rows.Something like registration form details.
<%@page import="java.sql.*" %>
<%
String fisname=request.getParameter("firstname");
String lstname=request.getParameter("lastname");
String sex=request.getParameter("gender");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:Bharath");
Statement st=con.createStatement();
DataInputStream din=new DataInputStream(System.in);
while(rs.afterlast())
{
int count=st.executeUpdate("insert into registeredusers values('"+firstname+"','"+lastname+"','"+gender+"')");
if(count>0)
{
out.println("Records Entered Successfully");
}
else
out.println("Insertion Failed");
}
}
catch(Exception e)
{
out.println(e);
}