DATABASE  as Authentication Data Source


SQL Table format:

                 USERID          VARCHAR(20) PRIMARY KEY
                PASSWORD     VARCHAR(20) NOT NULL
                LNAME             VARCHAR(30)
                FNAME             VARCHAR(30)
                EMAIL               VARCHAR(50)

To run the sample application Download the project files from here

Unpack the file under web application directory (webapps/)

Change the  authenticate/WEB-INF/Web-jdbc.xml into web.xml

According to your database in web.xml change JDBC Driver class, Database connection URL, database user name and password.


logon to database and create the user table ( SQL script you can find WEB-INF/data/userinfo.sql file)

insert some sample record in that table commit and exit from the database

Than start the web server and point your browser to http://localhost/authenticate/ URL you should be able to see index page.

Before starting the web server make sure you have database driver jar file in your class path.

To Debug please look into log file and web server console message.

This program tested with Oracle and MySQL database.