Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


nikila
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.
1 Answer(s)      2 years and 8 months ago
Posted in : JSP-Servlet


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


Advertisement
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



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
Connection using Jdbc-odbc bridge Driver
Connection using JDBC-ODBC bridge driver JDBCExample.java... database is ready to connect using JDBC-ODBC bridge driver. For this you have...;} } Output Description of Program In the above program, Jdbc-Odbc
Connect to MS Acces wothout using ODBC but JDBC - JDBC
Connect to MS Acces wothout using ODBC but JDBC  Hi, I want to connect my MS Access using JDBC but not ODBC. Please help me out. Thanks
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
jdbc odbc connection
jdbc odbc connection  i need a program in java which uses a jdbc odbc connection   Hi, You can create odbc datasource on your windows computer and then access in your Java program. Read the JDBC ODBC example. Thanks
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 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
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
MS Access - JDBC
MS Access  hello Mr.Kaleeswaran, thank you very much for giving information about MS access database...but still i am having doubt in that topic...("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:db1
Need Help in creating online quiz application using JSP - JSP-Servlet
Need Help in creating online quiz application using JSP  Hi, i am creating online Quiz application using JSP and MySQl ,Apache 6 in Netbeans IDE. i..., JSP Page Online Quize Application
MS Access - JSP-Servlet
problem is how to connect MS Acces database with servlets ... thank you..."); Connection con = DriverManager.getConnection("jdbc:odbc:db1... stepts 1.to configure the ms access database to your system control panel
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  
java &ms access - JDBC
for a food festival using Java swing as front end and MS access as Backend... ve managed to populate the JComboBox using MS Access. The problem is only 8 per... = DriverManager.getConnection("jdbc:odbc:access"); Statement st
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
MS Access` - JDBC
MS Access`  Hello Sir, Thank you very much for your valuable... to insert image into MS Access Database. Now the task is how to retrieve the image.... So please help me in this regard sir.. thank you sir
jdbc warning regarding to ms access
jdbc warning regarding to ms access  shows warning msg while compiling using ms access : warning: sun.jdbc.odbc.JdbcOdbcDriver is Sun proprietary API...=DriverManager.getConnection("jdbc:odbc:accdsn","",""); try{ Statement stmt
MS ACCESS - JDBC
MS ACCESS  java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'origin='src' destination='dest''. THAT MY PROBLEM
Thank you so much - JSP-Servlet
Thank you so much  Respected Sir/madam, By the grace of Sri guru Raghavendra, I have successfully got the output for my Image selection problem.. Lord Raghavendra has sent your team to help me in time.. Thanks
audio files in jdbc connectivity with ms-access - JDBC
to retrieve audio files through jdbc connectivity with ms-access and how to play... static void main(String[] args) { try{ String url="jdbc:odbc:access"; File... = DriverManager.getConnection("jdbc:odbc:access"); PreparedStatement ps
Updating Ms Access Database using jsp - JSP-Servlet
Updating Ms Access Database using jsp  Hi I am new to jsp and I am trying to update a record in an access database. I only want to update part... in the fields. Can you tell me what I am doing wrong.  Hi Friend, Create
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
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
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
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
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
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
code for jsp to db connection using jdbc
code for jsp to db connection using jdbc  please send me the code...("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc...;form method="post" action="http://localhost:8080/examples/jsp/insert.jsp"> <
Advertisements
 

 

 

DMCA.com