online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.

Ads
 

online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.

please provide online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.

View Answers

April 3, 2012 at 3:03 PM

Create table test(ques,op1,op2,op3,op4,ans) and answers(id,ans). Then try the following code:

1)form.jsp:

<%@page import="java.sql.*"%>
<html>
<form method="post" action="result.jsp">
<table>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root";, "root");
Statement st=connection.createStatement();
ResultSet rs=st.executeQuery("Select * from test");
int i=1;
while(rs.next()){
%>
<tr><td><%=i%></td><td><%=rs.getString("ques")%></td><td><input type="radio" value="<%=rs.getString("op1")%>" name="radio<%=i%>"/><%=rs.getString("op1")%></td><td><input type="radio" value="<%=rs.getString("op2")%>" name="radio<%=i%>"/><%=rs.getString("op2")%></td><td><input type="radio" value="<%=rs.getString("op3")%>" name="radio<%=i%>"/><%=rs.getString("op3")%></td><td><input type="radio" value="<%=rs.getString("op4")%>" name="radio<%=i%>"/><%=rs.getString("op4")%></td></tr>

<%
i++;
}
%>
<tr><td><input type="submit" value="submit"></td></tr>
</table>
</form>
</html>

2)result.jsp:

<%@page import="java.sql.*"%>

<%
String st[]=new String[10];
for(int i=0;i<st.length;i++){
int j=i+1;
st[i]=request.getParameter("radio"+j);
System.out.println(st[i]);

}
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/register","root";, "root");
Statement stmt=connection.createStatement();
ResultSet rs=stmt.executeQuery("Select ans from answers");
String ans="";
while(rs.next()){
ans+=rs.getString("ans")+" ";
}
int count=0;
String answers[]=ans.split(" ");
for(int i=0;i<answers.length;i++){
if(st[i].equals(answers[i])){
count++;
}
}
out.println("Your "+count+" answers are correct");
%>

For more information, visit the following link:

http://www.roseindia.net/jsp/online-quiz-application-jsp.shtml

Ads









Related Tutorials/Questions & Answers:
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.  please provide online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.   Create table test
Online quiz mini project
Online quiz mini project  Sir i need a online quiz program coding using java servlet, jdbc odbc connection with ms. access. If possible send that source code to me. Thank you
Advertisements
how to connect java with ms access using odbc in eclipse
how to connect java with ms access using odbc in eclipse  import..."); //Connection con = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.accdb)};DBQ=student.accdb","",""); Connection con
problem in jsp using ms-access
problem in jsp using ms-access  after starting server(tomcat) wen v...("jdbc:odbc:st") Can u pls help us in solving this pbm by giving whole source... = DriverManager.getConnection("jdbc:odbc:student"); Statement st=con.createStatement
JDBC ODBC Connection In Java
JDBC ODBC Connection In Java In this section we will read about the various aspects of JDBC ODBC such as, JDBC-ODBC bridge, JDBC ODBC connection, how... is sun.jdbc.odbc.JdbcOdbcDriver. JDBC ODBC Connection To Connect the JDBC and ODBC
JDBC-Odbc Connection
in explaining JDBC Odbc Connection in Java. The code explains you a how creation... JDBC-ODBC Connection       JDBC-ODBC Connection is a JDBC driver that translates the operation
Jdbc MS-Access question
Jdbc MS-Access question  How to delete records from the three table in MS-Access? They are in relationship with each other regarding to data field
Jdbc MS-Access question
Jdbc MS-Access question  How to delete records from the three table in MS-Access? They are in relationship with each other regarding to data field
Online Quiz Application in JSP
are going to implement of Online quiz application using of JSP. Step 1: Create... quiz question and answer form using with JSP or JDBC database.  Here... Online Quiz Application in JSP  
how to send emails to many using jsp by connecting to ms access dabase.
how to send emails to many using jsp by connecting to ms access dabase.  Hi. I am trying to send multiple emails and the email ids are stored in a table in a msaccess database.I am using jsp for this.And finally there should
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 insert values from jsp into ms access
how to insert values from jsp into ms access   how to insert values using jsp into ms access database
MS-Access
MS-Access  I am trying to upload a image to ms-acess using jsp,and my...: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect ".I think i set... = DriverManager.getConnection("jdbc:odbc:student"); File imgfile = new File("C:/rose.jpg
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... = DriverManager.getConnection("jdbc:odbc:student"); Statement st=con.createStatement
jsp coding please.
list. please show me how to do it? thank you. By the way, I'm using access..."); Connection con = DriverManager.getConnection("jdbc:odbc:student"); Statement...jsp coding please.  hi sir, my name is logeswaran. I have a problem
accessing ms access through jsp
accessing ms access through jsp  i have 3 tables in my database employee,project,task if i put employee id the search field .i should get details from other table what all queries should i use in servlet file and i am using
jdbc odbc
jdbc odbc  Sir, i want to get the selected value from JCombobox to ms... simply i just want to print in ms access or stored on ms acess databse in selected... = DriverManager.getConnection("jdbc:odbc:swing"); String sql = "INSERT
online shopping code using jsp
online shopping code using jsp  plz send me the code of online shopping using jsp or jdbc or servlets plz plz help me
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public... ODBC program,bt here I am getting error i.e Exception in Thread "main...)c.newInstance(); String s="jdbc:oracle:thin:@localhost:1521:ORCL
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public... ODBC program,bt here I am getting error i.e Exception in Thread "main...)c.newInstance(); String s="jdbc:oracle:thin:@localhost:1521:ORCL
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public... ODBC program,bt here I am getting error i.e Exception in Thread "main...)c.newInstance(); String s="jdbc:oracle:thin:@localhost:1521:ORCL
jdbc odbc
jdbc odbc  i want to fetch the data from the ms access and print on ms word for printing purpose?? the whole program is in swing to ms acess connectivity.. the whole set up is perform only printing part is remaining? so help me
jdbc odbc
jdbc odbc  i want to fetch the data from the ms access and print on ms word for printing purpose?? the whole program is in swing to ms acess connectivity.. the whole set up is perform only printing part is remaining? so help me
MS Access connct using flex with java
MS Access connct using flex with java  Hi All, Can anybody help me how to connect to the MS access database and getting the data using flex in java technology with tomcat server
to get picture from ms access database by jsp-servlet....
to get picture from ms access database by jsp-servlet....  I have inserted a picture in ms access data base,,,how we can retrieve that picture by using jsp
How to provide navigation in quiz application using jsp?
How to provide navigation in quiz application using jsp?  hi everyone. i am using jsp with mysql connectivity. i have to retrieve questions from db one at a time. on clicking the next it should go the next question
online shopping cart complete coding in pure jsp
online shopping cart complete coding in pure jsp  online shopping cart complete coding in pure jsp   Please visit the following link: JSP Online shopping cart
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question
inserting picture in ms access
inserting picture in ms access  hi i am sanatan, how to insert picture in ms access by jsp.   <%@page import="java.sql.*,java.io.*"%>..."); Connection con = DriverManager.getConnection("jdbc:odbc:student
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question
online quiz
online quiz  Define a Question class which stores a multiple choice...) level. Use the Question class to define a Quiz class. A quiz can be composed of up to 10 questions. Define the add method of the Quiz class to add a question

Ads