i have created a code which takes username pass etc from the user and then pts them in the database which is made using MSaccess the program complies very well but when i open my database no entries have been entered in there can u plz help

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


<%
Connection conn = null;
PreparedStatement pstmt = null;


%>

<% 
   String firstname = request.getParameter("yourname");
    String lastname = request.getParameter("endname");
    String UserId = request.getParameter("Rexmail Id:");
    
    String Password = request.getParameter("Password");
    String Password1 = request.getParameter("Re-type Password");
    String Answer = request.getParameter("Security Question");
    String Answer1 = request.getParameter("Your Answer");

 
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc:odbc:pubs1");

pstmt = conn.prepareStatement(" INSERT into books (firstname,lastname,id,pass,repass,que,ans) VALUES (?,?,?,?,?,?,?);");
pstmt.setString(1, firstname);
pstmt.setString(2, lastname);
pstmt.setString(3, UserId);
pstmt.setString(4, Password);
pstmt.setString(5, Password1);
pstmt.setString(6, Answer);
pstmt.setString(7, Answer1);




            
         pstmt.executeUpdate();
             pstmt.close();
out.println("account created");
} 

    

catch(Exception e) {
out.println("Error.."+e);
}

%>

First I'd like to inform you this is not a JSP forum.
And next don't perform Database operations inside your JSP.
And finally close your database connection after you are done with your transaction

Sorry forgot to mention that point No 3 (closing your database connection after executeUpdate() ) should most probably solve your current problem, else ... I guess you need some higher authorities help (on the forum that is ;) )

This article has been dead for over six months. Start a new discussion instead.