diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..9961451 --- /dev/null +++ b/.classpath @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..601be23 --- /dev/null +++ b/.project @@ -0,0 +1,36 @@ + + + online quiz + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/WebContent/CREATE TABLE.docx b/WebContent/CREATE TABLE.docx new file mode 100644 index 0000000..b3462c1 Binary files /dev/null and b/WebContent/CREATE TABLE.docx differ diff --git a/WebContent/META-INF/MANIFEST.MF b/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/WebContent/WEB-INF/lib/ojdbc14.jar b/WebContent/WEB-INF/lib/ojdbc14.jar new file mode 100644 index 0000000..0aa1b51 Binary files /dev/null and b/WebContent/WEB-INF/lib/ojdbc14.jar differ diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..eff6c71 --- /dev/null +++ b/WebContent/WEB-INF/web.xml @@ -0,0 +1,13 @@ + + + + index.jsp + + +com.javatpoint.MyListener + + diff --git a/WebContent/ask.jsp b/WebContent/ask.jsp new file mode 100644 index 0000000..d3f6a07 --- /dev/null +++ b/WebContent/ask.jsp @@ -0,0 +1,135 @@ + + + + +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + +Contact Us + + +
+
+ +
+
+ + + + +
+
+
+ +
+ + +
+ +
+
+
+

Contact Us

+ +

+Adress: H-109,Shakarpur
+ +Telephone: 0123456789
+ + + +Email: info@company.com
+

+
+
+ + + +
+ +

Ask Question

+
+
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ + +
+ + +

Our Clients

+ +
+ +

+javatpoint.com +

+
+ +
+ +

+cstpoint.com +

+
+
+ + + + + + + + +
+
+
+ \ No newline at end of file diff --git a/WebContent/askq.jsp b/WebContent/askq.jsp new file mode 100644 index 0000000..985a827 --- /dev/null +++ b/WebContent/askq.jsp @@ -0,0 +1,30 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@page import="java.sql.*"%> + + +<% + + try { + +String name= request.getParameter("name"); +String email= request.getParameter("email"); +String phone= request.getParameter("phone"); +String question= request.getParameter("question"); + +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); + +PreparedStatement ps=con.prepareStatement("insert into quizq values(?,?,?,?)"); +ps.setString(1,name); +ps.setString(2,email); +ps.setString(3,phone); +ps.setString(4,question); + +int s= ps.executeUpdate(); + + +} +catch(Exception e){e.printStackTrace();} + +%> + diff --git a/WebContent/contact.html b/WebContent/contact.html new file mode 100644 index 0000000..68ff144 --- /dev/null +++ b/WebContent/contact.html @@ -0,0 +1,135 @@ + + + + +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + +Contact Us + + +
+
+ +
+
+ + + + +
+
+
+ +
+ + +
+ +
+
+
+

Contact Us

+ +

+Adress: H-109,Shakarpur
+ +Telephone: 0123456789
+ + + +Email: info@company.com
+

+
+
+ + + +
+ +

Contact Us

+
+
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + +
+ +
+ + +
+ + +
+ + +

Our Clients

+ +
+ +

+javatpoint.com +

+
+ +
+ +

+cstpoint.com +

+
+
+ + + + + + + + +
+
+
+ \ No newline at end of file diff --git a/WebContent/createquiz.jsp b/WebContent/createquiz.jsp new file mode 100644 index 0000000..d9a95af --- /dev/null +++ b/WebContent/createquiz.jsp @@ -0,0 +1,15 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@page import="java.sql.*"%> + +<% try { +String subject= request.getParameter("subject"); +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +PreparedStatement ps=con.prepareStatement("insert into quizinfo(subject) values('"+subject+"') " ); +int s= ps.executeUpdate(); + + } +catch(Exception e){e.printStackTrace();} +%> + + diff --git a/WebContent/createquiz1.jsp b/WebContent/createquiz1.jsp new file mode 100644 index 0000000..f98af2c --- /dev/null +++ b/WebContent/createquiz1.jsp @@ -0,0 +1,157 @@ + +<%@page import="java.awt.Dialog"%> + +<% +String islogin=(String)session.getAttribute("islogin"); +if(islogin==null){ +request.setAttribute("notlogin_msg","Sorry,Please do Login first"); + +%> + +<% +} +%> + + <% + if(request.getAttribute("notlogin_msg")!=null){ + out.print(""); + out.print(request.getAttribute("notlogin_msg")); + out.print(""); + } + %> + <% + if(request.getAttribute("Error")!=null){ + out.print(""); + out.print(request.getAttribute("Error")); + out.print(""); + } + %> + <% + if(request.getAttribute("counter")!=null){ + Integer i=(Integer)request.getAttribute("counter"); + if(i==10){ + request.setAttribute("finished","quiz successfully submitted"); + + %> + + <% + + }} + %> +
+ +
+ +
+ +

Welcome to my Site

+ Assess Yourself by taking quizs on various sunject + +
+ + + + + + + + + +
Question:
Option1:
Option2:
Option3:
Option4:
Answer:
Description:
+
+ + + + +
+
+ + +
+

Latest News

+
+
23
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
23
+
+

+ we have latest projects uoloaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+
+ +
+ +
+ +
+ + +
+ + + + + + + + + + diff --git a/WebContent/findname.jsp b/WebContent/findname.jsp new file mode 100644 index 0000000..5197f66 --- /dev/null +++ b/WebContent/findname.jsp @@ -0,0 +1,17 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<% +String n=request.getParameter("val"); +if(n.length()>0){ +try{ +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +PreparedStatement ps=con.prepareStatement("select username from quizregister where username='"+n+"'"); +ResultSet rs=ps.executeQuery(); +while(rs.next()){ +out.print("Username already exist"); +} +con.close(); +}catch(Exception e){e.printStackTrace();} +}//end of if +%> \ No newline at end of file diff --git a/WebContent/findname2.jsp b/WebContent/findname2.jsp new file mode 100644 index 0000000..f2f18f8 --- /dev/null +++ b/WebContent/findname2.jsp @@ -0,0 +1,28 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> + + +<% +String n=request.getParameter("val"); +if(n.length()>0){ +try{ +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); + +PreparedStatement ps=con.prepareStatement("select * from quizinfo where subject like '"+n+"%'"); +//ps.setString(1,n); +out.print("
"); +ResultSet rs=ps.executeQuery(); + +out.print(""); +out.print(""); +while(rs.next()){ +out.print(""); +out.print(""); +out.print(""); +} +out.print("
QuizsSubject
Quiz"+rs.getString(2)+""+rs.getString(1)+"
"); +con.close(); +}catch(Exception e){e.printStackTrace();} +}//end of if +%> \ No newline at end of file diff --git a/WebContent/findname3.jsp b/WebContent/findname3.jsp new file mode 100644 index 0000000..25e3ccd --- /dev/null +++ b/WebContent/findname3.jsp @@ -0,0 +1,14 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> + + +<% +String n=request.getParameter("val"); +session.setAttribute("quizname",n); +if(n.length()>0){ +out.print("Quiz"+n+" containns 10 Question
Each question is of 1 point

"); +out.print(""); + +} +//end of if +%> \ No newline at end of file diff --git a/WebContent/footer.html b/WebContent/footer.html new file mode 100644 index 0000000..8be91e2 --- /dev/null +++ b/WebContent/footer.html @@ -0,0 +1,4 @@ + + diff --git a/WebContent/get.jsp b/WebContent/get.jsp new file mode 100644 index 0000000..6d7fca9 --- /dev/null +++ b/WebContent/get.jsp @@ -0,0 +1,60 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%--<%@page import="com.sun.org.apache.bcel.internal.generic.Select"--%> +<%! static int count=0; %> +<%! static int count1=0; %> + + + +<% +String name=(String)session.getAttribute("quizname"); +try{ + + +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +if(count==0){ +PreparedStatement ps1= con.prepareStatement("select min(qid) from quizques where quizname='"+name+"'"); +PreparedStatement ps2= con.prepareStatement("select max(qid) from quizques where quizname='"+name+"'"); +ResultSet rs1= ps1.executeQuery(); +ResultSet rs2=ps2.executeQuery(); +if(rs2.next()){ +count1=rs2.getInt(1); +session.setAttribute("max",count1); +} +if(rs1.next()){ +count=rs1.getInt(1); +session.setAttribute("min",count); + +} +} +if(count>0){ +PreparedStatement ps=con.prepareStatement("select * from quizques where quizname='"+name+"' and qid='"+count+"' "); +ResultSet rs=ps.executeQuery(); +while(rs.next()){ +String question=rs.getString(1); +String option1= rs.getString(2); +String option2= rs.getString(3); +String option3= rs.getString(4); +String option4= rs.getString(5); +session.setAttribute("question",question); +session.setAttribute("option1",option1); +session.setAttribute("option2",option2); +session.setAttribute("option3",option3); +session.setAttribute("option4",option4); +} + +} +System.out.print(count); +count++; +session.setAttribute("count",count); +if(count>(Integer)session.getAttribute("max")){ +count=0; +session.setAttribute("ans",null); +} +con.close(); + +}catch(Exception e){e.printStackTrace();} +//end of if +%> + \ No newline at end of file diff --git a/WebContent/get1.jsp b/WebContent/get1.jsp new file mode 100644 index 0000000..130ff19 --- /dev/null +++ b/WebContent/get1.jsp @@ -0,0 +1,93 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@ page import="java.sql.*" %> +<%-- <%@page import="com.sun.org.apache.bcel.internal.generic.Select"%>--%> + +<%! static int count1=0; %> + +<%! static int total=0; %> +<% +if(session.getAttribute("count")!=null){ +String name=(String)session.getAttribute("quizname"); +String ans= (String)session.getAttribute("ans"); +Integer count=(Integer)session.getAttribute("count"); +try{ +if(count1==0) +{ +count1=count-1; + +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+count1+"' "); +ResultSet rs=ps.executeQuery(); +if(rs.next()){ +String ans1=rs.getString(1); +System.out.println("ans1 on c10="+ans1); +System.out.println("ans on get1="+ans); +if(ans1.equals(ans)){ +total=total+1; +System.out.println("total="+total); +} + +} + +con.close(); +} + + + +else{ +count1=count-2; +System.out.print("count at get1:"+count); + +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+count1+"' "); +ResultSet rs=ps.executeQuery(); +if(rs.next()){ +String ans1=rs.getString(1); +System.out.println("ans1="+ans1); +System.out.println("ans on get1="+ans); +if(ans1.equals(ans)){ +total=total+1; +System.out.println("total="+total); + +} + +} +con.close(); +} +if(count>(Integer)session.getAttribute("max")) +{ +Integer max=(Integer)session.getAttribute("max"); +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+max+"' "); +ResultSet rs=ps.executeQuery(); +if(rs.next()){ +String ans1=rs.getString(1); +System.out.println("ans1 on c1="+ans1); +String ans2=(String) session.getAttribute("ans"); +System.out.println("ans on get1="+ans2); +if(ans1.equals(ans2)){ +total=total+1; +System.out.println("total="+total); +} + +} + +con.close(); +request.setAttribute("total",total); +total=0; +%> + + +<% + + +} + +}catch(Exception e){e.printStackTrace();} + +} +%> + \ No newline at end of file diff --git a/WebContent/header.jsp b/WebContent/header.jsp new file mode 100644 index 0000000..a0183ef --- /dev/null +++ b/WebContent/header.jsp @@ -0,0 +1,53 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + +Online Quiz + + + +
+
+ +
+ +
+ + + + + +
+ +
+
+

+

+
+ + +
\ No newline at end of file diff --git a/WebContent/home.jsp b/WebContent/home.jsp new file mode 100644 index 0000000..61c10bf --- /dev/null +++ b/WebContent/home.jsp @@ -0,0 +1,157 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + +<% +String islogin=(String)session.getAttribute("islogin"); +if(islogin==null){ +request.setAttribute("notlogin_msg","Sorry,Please do Login first"); + +%> + +<% +} +%> + + + +
+ <% + if(request.getAttribute("notlogin_msg")!=null){ + out.print(""); + out.print(request.getAttribute("notlogin_msg")); + out.print(""); + } + %> + <% + if(request.getAttribute("Error")!=null){ + out.print(""); + out.print(request.getAttribute("Error")); + out.print(""); + } + %> + <% + if(request.getAttribute("finished")!=null){ + out.print(""); + out.print(""); + out.print(request.getAttribute("finished")); + out.print(""); + out.print(""); + } + if(request.getAttribute("category")!=null){ + out.print(""); + out.print(request.getAttribute("category")); + out.print(""); + } + + %> +
+ +
+ +

Welcome to my Site

+ Assess Yourself by taking quizs on various subjects +

+ Now Teacher and Student can work together
+ online.Tutors are most welcomed to my site
+ they can create Quiz simply by clicking Make
+ Quiz link.And Students can appear in quiz based on various + subject.
+

+ + + + +
+
+ +
+

Latest News

+
+
1
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
2
+
+

+ we have latest projects uploaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+ + + + + +
+ + + + + +
+
+
+ + diff --git a/WebContent/images/Copy of parrot.png b/WebContent/images/Copy of parrot.png new file mode 100644 index 0000000..3dc056b Binary files /dev/null and b/WebContent/images/Copy of parrot.png differ diff --git a/WebContent/images/Thumbs.db b/WebContent/images/Thumbs.db new file mode 100644 index 0000000..ff868c7 Binary files /dev/null and b/WebContent/images/Thumbs.db differ diff --git a/WebContent/images/arrow.gif b/WebContent/images/arrow.gif new file mode 100644 index 0000000..aa61925 Binary files /dev/null and b/WebContent/images/arrow.gif differ diff --git a/WebContent/images/arrow.jpg b/WebContent/images/arrow.jpg new file mode 100644 index 0000000..f96598e Binary files /dev/null and b/WebContent/images/arrow.jpg differ diff --git a/WebContent/images/bg.jpg b/WebContent/images/bg.jpg new file mode 100644 index 0000000..1b41193 Binary files /dev/null and b/WebContent/images/bg.jpg differ diff --git a/WebContent/images/box_title_bg.gif b/WebContent/images/box_title_bg.gif new file mode 100644 index 0000000..af3923e Binary files /dev/null and b/WebContent/images/box_title_bg.gif differ diff --git a/WebContent/images/calendar_bg.gif b/WebContent/images/calendar_bg.gif new file mode 100644 index 0000000..24c490f Binary files /dev/null and b/WebContent/images/calendar_bg.gif differ diff --git a/WebContent/images/calendar_icon.gif b/WebContent/images/calendar_icon.gif new file mode 100644 index 0000000..2d06c27 Binary files /dev/null and b/WebContent/images/calendar_icon.gif differ diff --git a/WebContent/images/center_box_bg.gif b/WebContent/images/center_box_bg.gif new file mode 100644 index 0000000..d6e8369 Binary files /dev/null and b/WebContent/images/center_box_bg.gif differ diff --git a/WebContent/images/clients_icon.gif b/WebContent/images/clients_icon.gif new file mode 100644 index 0000000..4f17bbe Binary files /dev/null and b/WebContent/images/clients_icon.gif differ diff --git a/WebContent/images/contact_icon.gif b/WebContent/images/contact_icon.gif new file mode 100644 index 0000000..bd9a56b Binary files /dev/null and b/WebContent/images/contact_icon.gif differ diff --git a/WebContent/images/divider.gif b/WebContent/images/divider.gif new file mode 100644 index 0000000..3f15cef Binary files /dev/null and b/WebContent/images/divider.gif differ diff --git a/WebContent/images/footer_bg.gif b/WebContent/images/footer_bg.gif new file mode 100644 index 0000000..d44ecd7 Binary files /dev/null and b/WebContent/images/footer_bg.gif differ diff --git a/WebContent/images/link_more_bg.gif b/WebContent/images/link_more_bg.gif new file mode 100644 index 0000000..29566d8 Binary files /dev/null and b/WebContent/images/link_more_bg.gif differ diff --git a/WebContent/images/link_more_bg_a.gif b/WebContent/images/link_more_bg_a.gif new file mode 100644 index 0000000..aab4bc5 Binary files /dev/null and b/WebContent/images/link_more_bg_a.gif differ diff --git a/WebContent/images/logo.gif b/WebContent/images/logo.gif new file mode 100644 index 0000000..f6dcc37 Binary files /dev/null and b/WebContent/images/logo.gif differ diff --git a/WebContent/images/menu_arrow.gif b/WebContent/images/menu_arrow.gif new file mode 100644 index 0000000..5e11070 Binary files /dev/null and b/WebContent/images/menu_arrow.gif differ diff --git a/WebContent/images/menu_bg.gif b/WebContent/images/menu_bg.gif new file mode 100644 index 0000000..2e79d17 Binary files /dev/null and b/WebContent/images/menu_bg.gif differ diff --git a/WebContent/images/online quiz.jpg b/WebContent/images/online quiz.jpg new file mode 100644 index 0000000..eb666ff Binary files /dev/null and b/WebContent/images/online quiz.jpg differ diff --git a/WebContent/images/online_quiz.gif b/WebContent/images/online_quiz.gif new file mode 100644 index 0000000..786e319 Binary files /dev/null and b/WebContent/images/online_quiz.gif differ diff --git a/WebContent/images/p1.gif b/WebContent/images/p1.gif new file mode 100644 index 0000000..729b8b5 Binary files /dev/null and b/WebContent/images/p1.gif differ diff --git a/WebContent/images/p2.gif b/WebContent/images/p2.gif new file mode 100644 index 0000000..9b84330 Binary files /dev/null and b/WebContent/images/p2.gif differ diff --git a/WebContent/images/parrot.png b/WebContent/images/parrot.png new file mode 100644 index 0000000..84bc68c Binary files /dev/null and b/WebContent/images/parrot.png differ diff --git a/WebContent/images/top_bg.jpg b/WebContent/images/top_bg.jpg new file mode 100644 index 0000000..c79c8ce Binary files /dev/null and b/WebContent/images/top_bg.jpg differ diff --git a/WebContent/images/top_box.gif b/WebContent/images/top_box.gif new file mode 100644 index 0000000..093ae80 Binary files /dev/null and b/WebContent/images/top_box.gif differ diff --git a/WebContent/index.jsp b/WebContent/index.jsp new file mode 100644 index 0000000..51dc14d --- /dev/null +++ b/WebContent/index.jsp @@ -0,0 +1,183 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + +Login Form + + + + +
+
+ +
+
+ + + + + + +
+ +
+
+

+ +

+
+ + +
+ + +
+ <% + if(request.getAttribute("notlogin_msg")!=null){ + out.print(""); + out.print(request.getAttribute("notlogin_msg")); + out.print(""); + } + %> + <% + if(request.getAttribute("Error")!=null){ + out.print(""); + out.print(request.getAttribute("Error")); + out.print(""); + } + + + %> +
+ +
+ +

Welcome to my Site

+ +
+ + + + + + + + +
Login Form
Category: +
User Name:
Password:
Register
+
+ + + +
+
+ +
+

Latest News

+
+
23
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
23
+
+

+ we have latest projects uploaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+ + + + + +
+ + + + + +
+
+
+ \ No newline at end of file diff --git a/WebContent/loginprocess.jsp b/WebContent/loginprocess.jsp new file mode 100644 index 0000000..7900622 --- /dev/null +++ b/WebContent/loginprocess.jsp @@ -0,0 +1,46 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@page import="org.omg.CORBA.PUBLIC_MEMBER"%> +<%@page import="java.sql.*"%> +<%@page import="java.util.*"%> +<% +String username=request.getParameter("username"); +System.out.print(username); +String userpass=request.getParameter("userpass"); +String category=request.getParameter("category"); + +boolean status=false; +try{ +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +PreparedStatement ps=con.prepareStatement("select * from quizregister where username=? and userpass=? "); +ps.setString(1,username); +ps.setString(2,userpass); +ResultSet rs=ps.executeQuery(); +status=rs.next(); +if(status){ +System.out.print("hi"); +username=rs.getString(1); +session.setAttribute("username",String.valueOf(username)); +session.setAttribute("islogin","plz sign in first"); +session.setAttribute("category",category); +%> + +<% +} +else{ +System.out.print("hi"); +request.setAttribute("Error","Sorry! Username or Password Error. plz Enter Correct Detail or Register"); +session.setAttribute("Loginmsg","plz sign in first"); +%> + +<% +} +} + +catch(Exception e){ +e.printStackTrace(); +} + +%> + + diff --git a/WebContent/logout.jsp b/WebContent/logout.jsp new file mode 100644 index 0000000..ca5c39c --- /dev/null +++ b/WebContent/logout.jsp @@ -0,0 +1,23 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + + + + + +----//body tags +<% + +session.invalidate(); +response.setHeader("Cache-Control","no-store"); +response.setHeader("Pragma","no-cache"); +response.setDateHeader ("Expires", 0); + + + + +%> + \ No newline at end of file diff --git a/WebContent/makequiz.jsp b/WebContent/makequiz.jsp new file mode 100644 index 0000000..c52773b --- /dev/null +++ b/WebContent/makequiz.jsp @@ -0,0 +1,149 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + +<% +String islogin=(String)session.getAttribute("islogin"); +if(islogin==null){ +request.setAttribute("notlogin_msg","Sorry,Please do Login first"); + +%> + +<% +} +%> +
+ <% + if(request.getAttribute("notlogin_msg")!=null){ + out.print(""); + out.print(request.getAttribute("notlogin_msg")); + out.print(""); + } + %> + <% + if(request.getAttribute("Error")!=null){ + out.print(""); + out.print(request.getAttribute("Error")); + out.print(""); + } + if(session.getAttribute("category")!=null){ + String category=(String)session.getAttribute("category"); + if(category.equals("Student")){ + request.setAttribute("category","You are not a Teacher,You can't make Quiz"); + %> + + <% + } + + } + + + %> +
+ +
+ +

Welcome to my Site

+ Assess Yourself by taking quizs on various subjects + +
+ + + + +
Subject:
+
+ + + +
+
+ +
+

Latest News

+
+
1
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
2
+
+

+ we have latest projects uoloaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+ + + + + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/WebContent/quizcontact.jsp b/WebContent/quizcontact.jsp new file mode 100644 index 0000000..80218ea --- /dev/null +++ b/WebContent/quizcontact.jsp @@ -0,0 +1,30 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@page import="java.sql.*"%> + + +<% + + try { + +String name= request.getParameter("name"); +String email= request.getParameter("email"); +String phone= request.getParameter("phone"); +String message= request.getParameter("message"); + +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); + +PreparedStatement ps=con.prepareStatement("insert into quizcontact values(?,?,?,?)"); +ps.setString(1,name); +ps.setString(2,email); +ps.setString(3,phone); +ps.setString(4,message); + +int s= ps.executeUpdate(); + + +} +catch(Exception e){e.printStackTrace();} + +%> + diff --git a/WebContent/register.jsp b/WebContent/register.jsp new file mode 100644 index 0000000..d5a322a --- /dev/null +++ b/WebContent/register.jsp @@ -0,0 +1,197 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + +Registration Form + + + + +
+
+ +
+
+ + + + + +
+
+
+

+

+
+ + +
+ + +
+ +
+ +
+ +

Welcome to my Site

+

+
+ + + + + + + + + + + +
Registration
User Name:
Password:
Category: +
Email:
+
+ + +

+
+
+ +
+

Latest News

+
+
23
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
23
+
+

+ we have latest projects uploaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+ + + + + +
+ + + + + +
+
+
+ \ No newline at end of file diff --git a/WebContent/registerprocess.jsp b/WebContent/registerprocess.jsp new file mode 100644 index 0000000..4901db9 --- /dev/null +++ b/WebContent/registerprocess.jsp @@ -0,0 +1,23 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@page import="java.sql.*"%> +<%try{ + +String username=request.getParameter("username"); +String userpass=request.getParameter("userpass"); +String category=request.getParameter("category"); +String email=request.getParameter("email"); +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +PreparedStatement ps=con.prepareStatement("insert into quizregister values(?,?,?,?)"); + +ps.setString(1,username); +ps.setString(2,userpass); +ps.setString(3,category); +ps.setString(4,email); +int s=ps.executeUpdate(); +System.out.print(s); +}catch(SQLException e2){ +e2.printStackTrace(); +} +%> + diff --git a/WebContent/result.jsp b/WebContent/result.jsp new file mode 100644 index 0000000..6501521 --- /dev/null +++ b/WebContent/result.jsp @@ -0,0 +1,151 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + +<% +String islogin=(String)session.getAttribute("islogin"); +if(islogin==null){ +request.setAttribute("notlogin_msg","Sorry,Please do Login first"); + +%> + +<% +} +%> + + + +
+ <% + if(request.getAttribute("notlogin_msg")!=null){ + out.print(""); + out.print(request.getAttribute("notlogin_msg")); + out.print(""); + } + %> + <% + if(request.getAttribute("Error")!=null){ + out.print(""); + out.print(request.getAttribute("Error")); + out.print(""); + } + %> + <% + if(request.getAttribute("finished")!=null){ + out.print(""); + out.print(""); + out.print(request.getAttribute("finished")); + out.print(""); + out.print(""); + } + + %> +
+ +
+ +

Welcome to my Site

+ Assess Yourself by taking quizs on various subjects +
+

+ Your <%=request.getAttribute("total") %> questions are correct
+ +

+
+ + + + +
+
+ +
+

Latest News

+
+
1
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
2
+
+

+ we have latest projects uploaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+ + + + + +
+ + + + + + + + + + diff --git a/WebContent/saveques.jsp b/WebContent/saveques.jsp new file mode 100644 index 0000000..e736f57 --- /dev/null +++ b/WebContent/saveques.jsp @@ -0,0 +1,47 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@page import="java.sql.*"%> + +<%! static int counter=0; %> +<% +counter++; + try { +Class.forName("oracle.jdbc.driver.OracleDriver"); +Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); +String question= request.getParameter("question"); +String option1= request.getParameter("option1"); +String option2= request.getParameter("option2"); +String option3= request.getParameter("option3"); +String option4= request.getParameter("option4"); +String answer=request.getParameter("answer"); +String description=request.getParameter("description"); +PreparedStatement ps1=con.prepareStatement("select max(quizname) from quizinfo"); +ResultSet rs=ps1.executeQuery(); +while(rs.next()){ +String quizname= rs.getString(1); + +//System.out.print(quizname); + +PreparedStatement ps=con.prepareStatement("insert into quizques values(?,?,?,?,?,?,?,?,?)"); + +ps.setString(1,question); +ps.setString(2,option1); +ps.setString(3,option2); +ps.setString(4,option3); +ps.setString(5,option4); +ps.setString(6,answer); +ps.setString(7,quizname); +ps.setString(8,null); +ps.setString(9,description); +int s= ps.executeUpdate(); + + +} + +} +catch(Exception e){e.printStackTrace();} + +%> +<% +request.setAttribute("counter",counter); +%> + diff --git a/WebContent/start.jsp b/WebContent/start.jsp new file mode 100644 index 0000000..879f9fd --- /dev/null +++ b/WebContent/start.jsp @@ -0,0 +1,234 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + + + +<% +String islogin=(String)session.getAttribute("islogin"); +if(islogin==null){ +request.setAttribute("notlogin_msg","Sorry,Please do Login first"); + +%> + +<% +} +%> + + + +
+ <% + if(request.getAttribute("notlogin_msg")!=null){ + out.print(""); + out.print(request.getAttribute("notlogin_msg")); + out.print(""); + } + %> + <% + if(request.getAttribute("Error")!=null){ + out.print(""); + out.print(request.getAttribute("Error")); + out.print(""); + } + %> + <% + if(request.getAttribute("finished")!=null){ + out.print(""); + out.print(""); + out.print(request.getAttribute("finished")); + out.print(""); + out.print(""); + } + %> + +
+ +
+ +

Welcome to my Site

+ Assess Yourself by taking quizs on various sunject + +
+ + + + + + + +
+ <% + String question=(String)session.getAttribute("question"); + String option1= (String)session.getAttribute("option1"); + String option2= (String)session.getAttribute("option2"); + String option3= (String)session.getAttribute("option3"); + String option4= (String)session.getAttribute("option4"); + out.print(question); + %> + <% + if((String)request.getParameter("radio")!=null){ + String ans=(String)request.getParameter("radio"); + System.out.println("ans on set"+ans); + session.setAttribute("ans",ans); + + } %> +
<%=option1%>
<%=option2 %>
<%=option3 %>
<%=option4 %>
+
+ + + +
+
+ +
+

Latest News

+
+
1
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
2
+
+

+ we have latest projects uploaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+ + + + + +
+ + + + + + + + + + diff --git a/WebContent/style.css b/WebContent/style.css new file mode 100644 index 0000000..e973ec6 --- /dev/null +++ b/WebContent/style.css @@ -0,0 +1,294 @@ +body +{ +background:url(images/bg.jpg) repeat-x top #fff; +padding:0; +font-family:Verdana, Arial, Helvetica, sans-serif; +font-size:10px; +margin:0px auto auto auto; +color:#416271; +} +p{ +text-align:justify; +line-height:14px; +margin:0px; +} +span{ +color:#7cb805; +} +a{ +text-decoration:none; +color:#416271; +} +h1{ +width:225px; +margin:0 0 5px 0; +font-family:Arial, Helvetica, sans-serif; +font-size:12px; +color:#8c847a; +padding:5px 0 3px 0; +border-bottom:1px #CCCCCC dashed; +} +#main_container{ +width:900px; +height:auto; +margin:auto; +padding:0px; +position:relative; +background:url(images/top_bg.jpg) no-repeat left top; +} +.main_content{ +width:700px; +height:auto; +margin:auto; +} +.parrot{ +position:absolute; +top:0px; +left:45px; +} +#header{ +width:700px; +height:135px; +margin:auto; +} +.logo{ +padding:55px 0 0 115px; +} +.top_center_box{ +width:700px; +height:19px; +background:url(images/top_box.gif) no-repeat center; +} +.center_box{ +width:700px; +background-color:#FFFFFF; +} +/*---------------- menu tab----------------------*/ +#menu_tab{ +width:700px; +height:51px; +font-family:Arial, Helvetica, sans-serif; +padding:0px; +margin:auto; +background:url(images/menu_bg.gif) no-repeat center; +} + +ul.menu { +list-style-type:none; display:block; width:560px; +margin: auto; padding:0px; background:none;} + +ul.menu li { +display:inline; +font-size:13px; +font-weight:bold; +line-height:51px;} + +ul.menu li.divider { +display:block; +float:left; +width:1px; +height:51px; +padding:0px ; +margin:0px; +background:url(images/divider.gif) no-repeat center; +} + +a.nav:link, a.nav:visited { +display:block; float:left; padding:0px; margin:0;width: auto; margin:0px 14px 0px 14px; text-align:center; +text-decoration:none; background:none; color:#62584d;} + +a.nav_selected:link, a.nav_selected:visited { +display:block; float:left; padding:0px; margin:0;width: auto;margin:0px 14px 0px 14px;text-align:center; +text-decoration:none; color: #62584d; background:url(images/menu_arrow.gif) no-repeat top center;} + +a.nav:hover { +color: #62584d; text-decoration:none;background:url(images/menu_arrow.gif) no-repeat top center;} + +/*---------------middle_box-----------------*/ +.middle_box{ +width:654px; +height:161px; +background:url(images/center_box_bg.gif) no-repeat center; +margin:10px auto; +} +.middle_box_text_content{ +width:335px; +height:auto; +} +.middle_box_title{ +width:260px; +height:63px; +padding:5px; + +} +p.middle_text{ +padding:0 0 0 15px; +} +/*----------------left_content------------*/ +.left_content{ +width:345px; +float:left; +padding:10px; +} +.calendar_box{ +width:329px; + +background:url(images/calendar_bg.gif) no-repeat center; +} +.calendar_box2{ +width:329px; +} +.calendar_box_content{ +width:260px; +padding-left:53px; +} +.calendar_box_content1{ +width:260px; +padding-left:40px; +height:230px; +} +.calendar_box_content2{ +width:260px; +padding-left:40px; +height:400px; +} +.right_content{ +width:310px; +float:left; +padding:10px 0 0 0; +} +.news_left{ +padding:10px 0 0 10px; +} +.project_box{ +clear:both; +padding:10px 0 15px 0; +} +.project_box_portofolio{ +float:left; +padding:10px 15px 15px 15px; +} +img.left_img{ +float:left; +padding:0 15px 0 0; +} +.news_box{ +padding:5px 0 5px 0; +} +.calendar{ +width:42px; +height:47px; +float:left; +background:url(images/calendar_icon.gif) no-repeat center; +text-align:center; +line-height:47px; +font-size:14px; +font-weight:bold; +color:#5d2c1a; +} +.news_content{ +width:270px; +float:left; +padding:0 0 0 10px; +} +a.read_more{ +width:75px; +height:29px; +display:block; +float:right; +margin:5px; +background:url(images/link_more_bg.gif) no-repeat center; +text-decoration:none; +color:#6c331f; +text-align:center; +line-height:29px; +} +a.read_more_a{ +width:75px; +height:29px; +display:block; +float:right; +margin:5px; +background:url(images/link_more_bg_a.gif) no-repeat center; +text-decoration:none; +color:#dcc1b7; +text-align:center; +line-height:29px; +} +.wide_content{ +width:660px; +clear:both; +padding:0 20px 0 20px; +} +.projects_navigation{ +padding-right:250px; +} +p.contact_info{ +padding:10px 0 0 20px; +line-height:18px; +} +span.orange{ +color:#f89824; +} +/*-----------------------contact_form-------------------*/ +#contact_form{ +width:300px; +height:auto; +padding:10px 0 0 20px; +} +.form_row{ +float:left; +padding:8px 0 8px 0; +} +label{ +width:55px; +float:left; +padding:3px 5px 0 0; +color:#8ebb41; +text-align:right; +} +input.contact_input{ +width:225px; +height:18px; +float:left; +border:1px #d1e0ee solid; +background-color:#eef4d7; +color: #000; +} +textarea.contact_textarea{ +width:225px; +height:80px; +float:left; +border:1px #d1e0ee solid; +background-color:#eef4d7; +color: #000; +} +/*----------------------services-------------------------*/ +.services{ +float:left; +} +.services ul{ +list-style:none; +padding:15px 10px 5px 0; +margin:0px; +} +.services ul li{ +padding:5px; +} +.services ul li a{ +background:url(images/arrow.gif) no-repeat left; +padding:0 0 0 25px; +text-decoration:none; +color:#416271; +} + + +/*--------------------footer--------------------*/ +#footer{ +width:680px; +height:16px; +clear:both; +color:#763c26; +padding:30px 0 0 20px; +background:url(images/footer_bg.gif) no-repeat center; +} diff --git a/WebContent/takequiz.jsp b/WebContent/takequiz.jsp new file mode 100644 index 0000000..14ba095 --- /dev/null +++ b/WebContent/takequiz.jsp @@ -0,0 +1,207 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + + + + +<% +String islogin=(String)session.getAttribute("islogin"); +if(islogin==null){ +request.setAttribute("notlogin_msg","Sorry,Please do Login first"); + +%> + +<% +} +%> + + + +
+ <% + if(request.getAttribute("notlogin_msg")!=null){ + out.print(""); + out.print(request.getAttribute("notlogin_msg")); + out.print(""); + } + %> + <% + if(request.getAttribute("Error")!=null){ + out.print(""); + out.print(request.getAttribute("Error")); + out.print(""); + } + %> + <% + if(request.getAttribute("finished")!=null){ + out.print(""); + out.print(""); + out.print(request.getAttribute("finished")); + out.print(""); + out.print(""); + } + + %> +
+ +
+ +

Welcome to my Site

+ Assess Yourself by taking quizs on various subjects + +
+ + Enter the subject: +
+
+ + + +
+
+ +
+

Latest News

+
+
1
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
2
+
+

+ we have latest projects uploaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+ + + + + +
+ + + + + + + + + + diff --git a/WebContent/test.jsp b/WebContent/test.jsp new file mode 100644 index 0000000..39bf2e2 --- /dev/null +++ b/WebContent/test.jsp @@ -0,0 +1,5 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> + + + + \ No newline at end of file diff --git a/WebContent/view.jsp b/WebContent/view.jsp new file mode 100644 index 0000000..e6618af --- /dev/null +++ b/WebContent/view.jsp @@ -0,0 +1,163 @@ +<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> +<%@page import="java.sql.*"%> + + + + + +<% +String islogin=(String)session.getAttribute("islogin"); +if(islogin==null){ +request.setAttribute("notlogin_msg","Sorry,Please do Login first"); + +%> + +<% +} +%> + + + +
+ <% + if(request.getAttribute("notlogin_msg")!=null){ + out.print(""); + out.print(request.getAttribute("notlogin_msg")); + out.print(""); + } + %> + <% + if(request.getAttribute("Error")!=null){ + out.print(""); + out.print(request.getAttribute("Error")); + out.print(""); + } + %> + <% + if(request.getAttribute("finished")!=null){ + out.print(""); + out.print(""); + out.print(request.getAttribute("finished")); + out.print(""); + out.print(""); + } + + %> +
+ +
+ +

Welcome to my Site

+ Assess Yourself by taking quizs on various subjects + <% + String name=(String)session.getAttribute("quizname"); + try{ + Class.forName("oracle.jdbc.driver.OracleDriver"); + Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); + PreparedStatement ps= con.prepareStatement("select * from quizques where quizname='"+name+"'"); + ResultSet rs=ps.executeQuery(); + out.print(""); + while(rs.next()){ + out.print(""); + out.print(""); + out.print(""); + + } + out.print("
Question:"+rs.getString(1)+"
Answer:"+rs.getString(6)+"
Description:"+rs.getString(9)+"
"); + + }catch(Exception e){e.printStackTrace();} + %> + + + +
+
+ +
+

Latest News

+
+
1
+
+

+ now learn how to develop android application free of cost


+ read more +
+
+
+
+
2
+
+

+ we have latest projects uploaded on my site

+ read more +
+
+ + + + +
+ + +
+ + + +
+ + +

Latest Projects

+ +
+ +

+ Description:
+ Payment billing System + Online Quiz
+ Matrimonial + +

+
+ +
+ +

+ Description:
+ + Gmail Account
+ Latest Quiz +

+
+
+
+ +


Our main Services

+
+ + + + + +
+ + + + + + + + + + diff --git a/build/classes/com/javatpoint/MyListener.class b/build/classes/com/javatpoint/MyListener.class new file mode 100644 index 0000000..769fb3d Binary files /dev/null and b/build/classes/com/javatpoint/MyListener.class differ diff --git a/src/com/javatpoint/MyListener.java b/src/com/javatpoint/MyListener.java new file mode 100644 index 0000000..d5078c9 --- /dev/null +++ b/src/com/javatpoint/MyListener.java @@ -0,0 +1,58 @@ +package com.javatpoint; +import javax.servlet.*; +import java.sql.*; + +public class MyListener implements ServletContextListener{ + + public void contextInitialized(ServletContextEvent arg0) { + + Connection con=null; + try{ + ResultSet rs; + Class.forName("oracle.jdbc.driver.OracleDriver"); + con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle"); + + PreparedStatement ps1=con.prepareStatement("Select * from QUIZCONTACT"); + + rs=ps1.executeQuery(); + if(rs.next()) + {System.out.println("your table name already exist");} + else + {System.out.println("else if part table does not exist new table has created"); + + + PreparedStatement ps2= con.prepareStatement("CREATE SEQUENCE JAVATPOINT MINVALUE 1 MAXVALUE 999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE"); + ps2.executeUpdate(); + PreparedStatement ps=con.prepareStatement("CREATE TABLE QUIZCONTACT (NAME VARCHAR2(4000),EMAIL VARCHAR2(4000),PHONE VARCHAR2(4000),MESSAGE VARCHAR2(4000))"); + ps.executeUpdate(); + PreparedStatement ps4=con.prepareStatement("CREATE TABLE QUIZINFO (SUBJECT VARCHAR2(4000),QUIZNAME VARCHAR2(4000))"); + ps4.executeUpdate(); + + + PreparedStatement ps5=con.prepareStatement("CREATE TABLE QUIZQ(NAME VARCHAR2(4000),EMAIL VARCHAR2(4000),PHONE VARCHAR2(4000),QUESTION VARCHAR2(4000))"); + ps5.executeUpdate(); + + + ps5= con.prepareStatement("CREATE TABLE QUIZQUES(QUESTION VARCHAR2(4000),OPTION1 VARCHAR2(4000),OPTION2 VARCHAR2(4000),OPTION3 VARCHAR2(4000),OPTION4 VARCHAR2(4000),ANSWER VARCHAR2(4000),QUIZNAME VARCHAR2(4000),QID VARCHAR2(4000),DESCRIPTION VARCHAR2(4000),CONSTRAINT QUIZQUES_PK PRIMARY KEY (QID) ENABLE)"); + ps5.executeUpdate(); + + + ps5= con.prepareStatement("CREATE TABLE QUIZREGISTER (USERNAME VARCHAR2(4000),USERPASS VARCHAR2(4000),CATEGORY VARCHAR2(4000),EMAIL VARCHAR2(4000))"); + ps5.executeUpdate(); + Statement stmt=con.createStatement(); + stmt.executeUpdate("CREATE TRIGGER BI_QUIZINFO before insert on QUIZINFO for each row begin select JAVATPOINT.nextval into :NEW.QUIZNAME from dual;end"); + stmt.executeUpdate("CREATE TRIGGER BI_QUIZQUES before insert on QUIZQUES for each row begin select JAVATPOINT.nextval into :NEW.QID from dual;end"); + } + } + + catch(Exception e){ + e.printStackTrace(); + + } + } + + public void contextDestroyed(ServletContextEvent arg0) { + System.out.println("project undeployed"); + + } +}