How to store user registration details into database(MS Access database), and how to validate the username and password, If again the same person logins.

How to store user registration details into database(MS Access database), and how to validate the username and password, If again the same person logins.

Please help me, My Question is -

How to store user registration details into database(MS Access database), and how to validate the username and password, If again the same person logins. Please write the programs in Servlets,JavaBeans and jsp.

View Answers

September 11, 2012 at 5:31 PM

First of all, connect jsp to MS access database. So follow these steps:

1)Go to the start->Control Panel->Administrative Tools-> data sources.

2)Click Add button and select the driver Microsoft Access Driver(*.mdb).

3)After selecting the driver, click finish button.

4)Then give Data Source Name and click ok button.

5)Your DSN will get created.

6) Restart your tomcat server and run your jsp code.

1)form.jsp:

<html>
<head>
<script type="text/javascript">
function check(value){ 
xmlHttp=GetXmlHttpObject()
var url="check.jsp";
url=url+"?name="+value;
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged(){ 
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
    var showdata = xmlHttp.responseText; 
    alert(showdata);
    document.getElementById("name").value=" ";
    } 
}
function GetXmlHttpObject(){
var xmlHttp=null;
try{
  xmlHttp=new XMLHttpRequest();
 }
catch (e) {
 try {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e){
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
</script>
</head>
<body>
<form name="form" action="insert.jsp">
<pre>
 UserName: <input  type="text" name="name" id="name" onkeyup="check(this.value);">
 Password: <input  type="password" name="pass" id="pass">
 Address : <input  type="text" name="address" id="address">
 Contact : <input  type="text" name="contact" id="contact">
 Email   : <input  type="text" name="email" id="email">
           <input  type="submit" value="Submit">
 </pre>
</form>    

</body>
</html>

2)check.jsp:

<%@ page import="java.sql.*" %> 
<%
String name = request.getParameter("name").toString();
System.out.println(name);
String data ="";
try{
           Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
           Statement st=con.createStatement();
           ResultSet rs=st.executeQuery("select * from login where username='"+name+"'");
int count=0;
          while(rs.next())
          {

                   count++;
          }

                    if(count>0)
          {
             data="Not Available";
          }
          else
          {
          }
out.println(data);
System.out.println(data);
}
catch (Exception e) {
System.out.println(e);
}
%>

3)insert.jsp:

<%@page import="java.sql.*"%>
<%
String user=request.getParameter("name");
String pass=request.getParameter("pass");
String address=request.getParameter("address");
String contact=request.getParameter("contact");
String email=request.getParameter("email");


Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:student","","");

Statement st=con.createStatement();
int i=st.executeUpdate("insert into data(username,password,address,contact,email) values('"+user+"','"+pass+"','"+address+"','"+contact+"','"+email+"')");
out.println("Data is inserted successfully");
%>

September 13, 2012 at 11:10 AM

Hi, Please use servlets, where the Servlet program will store or retrieve the user details. And also use PreparedStament(JDBC) for storing information into database.

By the way.. Thanks for the program and Please do the needful.









Related Tutorials/Questions & Answers:
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  ... import="java.sql.*" %> <% Connection con=null; String user=request.getParameter("userid"); session.putValue("userid",user); String pwd
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  ... import="java.sql.*" %> <% Connection con=null; String user=request.getParameter("userid"); session.putValue("userid",user); String pwd=request.getParameter
Advertisements
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  ... import="java.sql.*" %> <% Connection con=null; String user=request.getParameter("userid"); session.putValue("userid",user); String pwd
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  ... import="java.sql.*" %> <% Connection con=null; String user=request.getParameter("userid"); session.putValue("userid",user); String pwd=request.getParameter
how to check username & password from database using jsp
how to check username & password from database using jsp  Hello, I have created 1 html page which contain username, password & submit button. in my oracle10G database already contain table name admin which has name, password
How to store JComboBox selected Item into Ms Access Database - Java Beginners
How to store JComboBox selected Item into Ms Access Database  How to store JComboBox selected Item into Ms Access Database.  Hi Friend...:access","",""); Statement stmt=con.createStatement(); ResultSet rs
how to store image file and videofile in ms access database using java? - JDBC
how to store image file and videofile in ms access database using java?  how to store image file and video file in ms access database using java
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?   first registration with email , username, password after >> <> without
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?   first registration with email , username, password after >> <> without
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?   first registration with email , username, password after >> <> without
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?   first registration with email , username, password after >> <> without
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?   first registration with email , username, password after >> <> without
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?   first registration with email , username, password after >> <> without
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?
servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ?   first registration with email , username, password after >> <> without
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database - Java Beginners
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database  Hello Sir I want Store Corse Type that contains Two JRadioButton I want Store Information from JRadioButton to MS Access Database, and I
validating username and password from database
validating username and password from database  Hello sir, i am developing a login page. i want that when i fill data in text fields. it validate data from database. if enter data is match from database. page goes to next page
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records of ms access with java   Java MS Access database connectivity Follow
how to access the MS ACCESS database with java - Java Beginners
how to access the MS ACCESS database with java  how can we insert,delete,update,search records of ms access with java
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc..., 1)I am in need of code to establish username and password of gmail 2)code in jsp to validate the username and password of my gmail mentioned above
User Registration Form Using JSP(JspBeans) after that how i can insert in database
User Registration Form Using JSP(JspBeans) after that how i can insert in database   User Registration Form Using JSP(JspBeans) after that how i can insert in database
How To Connect MS ACCESS 2003 Database in C Program with Graphics.
How To Connect MS ACCESS 2003 Database in C Program with Graphics.  How To Connect MS ACCESS 2003 Database in C Program with Graphics
How to store image into database
How to store image into database  Hi, all I want to store image into database using Java. Can anyone help me that how can i store image into database... through the following link How To Store Image Into MySQL Using Java
how to connect to MS access database in JSP?
how to connect to MS access database in JSP?  how to connect to MS access database in JSP? Any seetings/drivers need to be set or installed before... and select the driver Microsoft Access Driver(*.mdb). 3)After selecting the driver
Ajax Registration Program
to validate the user registration through ajax call and then display the alert massage if no values are provided in the username and password fields. When a user input user Id and password and press Register button , method 'call_Register
How can I protect my database password ?
How can I protect my database password ?   How can I protect my database password ? I'm writing a client-side java application that will access..., where the connection string to the database, including user and password, is stored
How to store user name,city,state,image path into database and image into folder using jsp
How to store user name,city,state,image path into database and image into folder using jsp  How to store user name,city,state,image path into database and image into folder using jsp
How to store an image in database
How to store an image in database  Hi........... How to store an image in postgresql using a query. I mean tell me the way to store an image using datatype. I am using the datatype bytea but tell me how to insert the image
Write a program to get student details and store in a database
Write a program to get student details and store in a database  Write a program to get student details and store in a database
user registration
user registration  hi frnds...am working on a project in JSP.i want to create a user registration form with username,password,mail id and check box... it in Ms Access database for admin purpose.pls help me with this coding guys
How to Store Float Value into Access Database - Java Beginners
How to Store Float Value into Access Database  Hello sir,I want to Store Student Marks Percentage into Access Database in Float Value how i can Store.... To store the double value in Access database, you need to set the datatype
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  Hi all my Friends I have below code which insert a picture into M.S. Access Database But i m still not able to open this picture through Java using M.S. Access
How To Insert A New Record to MS Access table database in GUI
How To Insert A New Record to MS Access table database in GUI  Hello... that involves inserting a record into a 6-column table in my MS Access database table. I'm... on the actionPerformed events. The problem I'm having is that when the user clicks
Design a registration.jsp page with input for user registration details
Design a registration.jsp page with input for user registration details  Design a registration.jsp page with input for user registration details like firstname, lastname, choose username, choose password, confirm password. After
HTML(Registration form) to Jsp to stored into MS ACCESS database
HTML(Registration form) to Jsp to stored into MS ACCESS database  i am sending one html file that contain 18 fields these are stored in ms-access database by using jsp code.i want to urgent jsp code. please urgent sir. thank
how to delete specified coloumn from database(MS Access) by using windows application
how to delete specified coloumn from database(MS Access) by using windows application  how to delete specified coloumn from database(MS Access) by using c# windows application
Java swing store the encrypted password into database
Java swing store the encrypted password into database In this tutorial, you will learn how to encrypt the password and insert it into database. Here is an example that creates two fields to accept username and password from the user
how to access database in applet
how to access database in applet  HI... I'm having an applet where we...; private String driver; private String userName; private String passWord; private..."); userName = (String)hsp.get("setUserName"); passWord = (String)hsp.get
How to store JComboBox item into database
How to store JComboBox item into database   import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; import
How to insert or delete records in MS access database using jsp - JSP-Servlet
How to insert or delete records in MS access database using jsp  Hi friends please provide me a solution that i insert or delete record from a database using java server pages. I used the microsoft access 2003 database. PlZ
How to store and retrieve image from database in JSP?
How to store and retrieve image from database in JSP?  Hi, In one of my application I have to store and then display the image in JSP. How to store and retrieve image from database in JSP? Thanks   HI, You can use
link hibernate to MS ACCESS database
link hibernate to MS ACCESS database  how to link hibernate to ms access database instead of sql database
How can we encrypt the username and password using PHP?
How can we encrypt the username and password using PHP?  How can we encrypt the username and password using PHP
how to create a user registration form in php
how to create a user registration form in php  how to create a user registration form in php
How to Display Username After Login in JSP
page in which username and password is created. So, when you submit the details...How to Display Username After Login in JSP In this section we will discuss how to display the Username and password after the successful login. In JSP
Java Read username, password and port from properties file
Java Read username, password and port from properties file In this section, you will come to know how to read username, password and port no from... username=root password=root port=3306 Here is the code:ADS
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use...;" + "databaseName=Book Avenue Tables; user=sa; password=12345678

Ads