JavaExam.Com

JavaExam.Com is a website that provides online examination of Java Language. Users must register to take exam. It stores results regarding the previous exams taken by users. It provides all the common operations related to users such as registration, login, change password and forgot password.

Architecture Of the Project

This project uses JSPs to interact with users - view. JavaBeans are used to handle business logic. JSPs pass data to JavaBeans.

JavaBeans access DAO (Data Access Layer) layer to access database. The entire data access is centralized in DAO.

DAOs use JDBC to take to Oracle Database 10g.

So overall architecure is - JSP -> JavaBean -> DAO -> JDBC -> Oracle Database.

It also uses a filter (Intercepting Filter design pattern) to ensure only authenticated users access secured pages.

Products used in this project

Steps to download and deploy this project

  1. Download javaexam.rar. The .rar file contains the entire source code for the project. Unzip the file into C:\ so that c:\javaexam folder is create with all the components of the project.
  2. However, it doesn't contain any .jar files related to Java Mail - mail.jar and activation.jar and Oracle - ojdbc14.jar. You have to add these .jar files to this project. Use libraries node in NetBeans to do it. Select libraries then Add Library options and Add Folder/Jar for the rest of .jar files.
  3. Create javaexam account with password javaexam in Oracle10g Express Edition. This must be done after you log in as SYSTEM user. Then create tables listed below.
    create user javaexam identified by javaexam;
    grant connect, resource to javaexam;
    
    connect  javaexam/javaexam;
    
    create table users 
    (  uname varchar(10)  primary key,
       pwd   varchar(10),
       email  varchar(50)  unique,
       dor    date
    );
    
    create table questions
    (  qid  number(5)  primary key,
       question varchar(2000),
       ans1   varchar(1000),
       ans2   varchar(1000),
       ans3   varchar(1000),
       ans4   varchar(1000),
       cans    char(1)
    );
    
    create table exams
    (  examid  number(5) primary key,
       uname   varchar(10)  references users(uname),
       dexam   date,
       score   number(2)
    );
    
    
    insert into questions values(1,'What is the size of char data type',
              '2 byte',
              '1 byte',
              'Depends on OS',
              '3 bytes',
              1);
    
    insert into questions values(2,'Which of the following not a method in Object class?',
              'toString()',
              'wait()',
              'finalize()',
              'compare()',
              4);
    
    insert into questions values(3,'Which is NOT a valid operator in Java?',
              '++',
              '+=',
              '_',
              '>>',
              3);
    
    insert into questions values(4,'Which class do you use if you have to represent a collection of unique values that are sorted?',
          'ArrayList',
          'Vector',
          'HashSet',
          'TreeSet',
          4);
    
    insert into questions values(5,'What is downcasting?',
          'Converting superclass to subclass',
          'Converting subclass to superclass',
          'Converting Interface to class',
          'Converting structure to class',
          1);
    
    insert into questions values(6,'What is boxing?',
          'Converting primitive type to object',
          'Converting object to primitive type',
          'Converting one primitive type to another',
          'Converting one object to another object',
          1);
    
    insert into questions values(7,'Which of the following is an Interface in Collection API',
          'ArrayList',
          'IList',
          'Comparator',
          'Stack',
          3);
    
    insert into questions values(8,'Which is one of the differences between class and an interface?',
          'Interface does not support inheritance',
          'Interface cannot have object',
          'Interface cannot have object reference',
          'Interface cannot have variables',
          2);
    
    insert into questions values(9,'Which of the following is correct about final variables?',
          'It must be assigned a value at the time of declaration',
          'It must be of int type',
          'It must be assigned a value before constructor of the class is completed',
          'It must be assigned a value before any method in the class is called',
          3);
    
    
    insert into questions values(10,'Which two keywords are mutually exclusive?',
          'final and abstrcat',
          'final and static',
          'final and sychronized',
          'all the above',
          1);
    
    
    insert into questions values(11,'Which of the following keywords are related to multithreading?',
          'final',
          'synchronized',
          'thread',
          'running',
          2);
    
    
    insert into questions values(12,'How do you determine whether an object reference points to a particular type of object?',
          'points',
          'typeof',
          'instanceof',
          'objectof',
          3);
    
    
    insert into questions values(13,'Which is the stream used to read a complete line at a time?',
          'FileReader',
          'Reader',
          'BufferedReader',
          'StreamReader',
          3);
    
    
    insert into questions values(14,'Which of the following features was introduced in Java 5.0?',
          'inner classes',
          'static members',
          'final members',
          'static import',
          4);
    
    
    insert into questions values(15,'What is the parameter type for equals() method in Object class?',
          'String',
          'Object',
          'It depends on the calling object',
          'It has no parameter',
          2);
    
  4. Create an account in CMail Server (Mail Server from youngzsoft.net and configure Outlook express to add a mail account for the user created in CMail Server. At the time of registering user in the project using register.jsp, use this email address for user so that you can test forgot password feature using this email address.
  5. Start NetBeans 6.5. Open the project from c:\javaexams folder.
  6. Run this project - you must see login.jsp page.