Você está na página 1de 9

Exam-portal-java-project-with-sourcecode

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


Oracle10g Express Edition NetBeans IDE 6.5 Jdk 6.0 Tomcat 6.x CMail Server 5.x

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. .After installing oracle10gXEStartAll Programs->Oracle 10gExpressEdition->Go to Database Home Page. Login as SYSTEM user(password jo initially set kiya tha during installation)

2.Go to Database Administration->Database UsersCreate User

3.Create User with usernamejavaexam and Passwordjavaexam Check all the checkboxes below.Click Create.

4.Logout and login as Usernamejavaexam 5.go to Object BrowserCreateTable

6.Create Tables as follows

1.users
uname varchar2(10) primary key, pwd varchar2(10), email varchar2(50) dor date [primary key ke option pe click krna and unpopulated select krna den job bhi column primary key bnana hai select kr lena]

2.exams
examid uname dexam score number(5) primary key, varchar2(10) references users(uname), date, number(2)

3.questions
qid number(5) primary key, question varchar2(2000), ans1 varchar2(1000), ans2 varchar2(1000), ans3 varchar2(1000), ans4 varchar2(1000), cans char(1)

7.go to home page again of oracle 8/go to SQL->SQl Commands->Enter Command

9.copy and paste one by one below written queries and click run.

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);

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. Stalrt NetBeans . Open the project from c:\javaexams folder. 3. 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. (sent u the jar files in mail) [ojdbc14.jar first Add library dialog box me change the library name to oracle..then add ojdbc14.jar to it]m Run this project - you must see login.jsp page.
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);

Você também pode gostar