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



Home Answers Viewqa JSP-Servlet jsp online ex

Have Programming Question? Ask it here!
 
 
 


shanthala
jsp online ex
2 Answer(s)      a year and 8 months ago
Posted in : JSP-Servlet


plz help me providing source code for mini project online exam using jsp and mysql..... plzplz plzhelp me pur....


Advertisement
View Answers

November 8, 2012 at 4:18 PM


We are providing you a simple application.

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 links:

http://www.roseindia.net/struts/struts/struts2.2.1/onlinetestapp/index.html

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



November 8, 2012 at 4:26 PM


i used this code sir...am not getting where to place questions plz help me



Related Tutorials/Questions & Answers:
jsp online ex
jsp online ex  wat is the parametr u passed ...ques
jsp online ex
jsp online ex  how to sum up the count of a cloumn in mysql and display ot on jsp when asked to calculate
Advertisements
jsp online ex
jsp online ex  plz help me providing source code for mini project online exam using jsp and mysql..... plzplz plzhelp me pur
jsp online ex
jsp online ex  deepak sir please help me...i jave created jsp page containing a question with 4 optipns and now i want tp save the options selected inside mysql and then retrievecot for checking it wit correctness...plzzzzzzzzz
online bookstore - JSP-Servlet
online bookstore  i want to display some books like online shoping.please send me code for that using jsp and servlets
jsp online exam...
jsp online exam...  Plz provide me front end design
jsp online exam
jsp online exam  i have designed a html page with 20 multiple choice questions ...options are in radio button for each question .... now i have to retrieve all the selected answers and save it to database match it with correct
secure online payment code for jsp
secure online payment code for jsp   how to implements online payment in jsp
online bookstore - JSP-Servlet
online bookstore  i want code for online bookshop.please send mo soon..........  Hi Friend, Please specify some details. Thanks
online examination system project in jsp
online examination system project in jsp  How many tables are required in SQL for online examination system project in jsp in java my email id
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
online examination system project in jsp
online examination system project in jsp  How many tables are required in SQL for online examination system project in jsp in java
online examination system project in jsp
online examination system project in jsp  How many and which data tables are required for online examination system project in jsp in java. please give me the detailed structure of each table
online test software using jsp and servlet
online test software using jsp and servlet  online test software using jsp and servlet
how to create online exam in jsp and database
how to create online exam in jsp and database  learing stage ,want to know how to create online exam
online examination system project in jsp
online examination system project in jsp  How to show the status bar which shows how much time is remaining in online examination system in jsp.my
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 examination system project in jsp
in jsp for online examination system...; For more information, visit the following link: http://www.roseindia.net/jsp/online...online examination system project in jsp  I am doing project
online examination system project in jsp
online examination system project in jsp  thanks for providing me 6 tables for online examination system. I want to know what will the id field of Answers1 table contain? Will it contain same id for all the questions of Set1 &
online examination system project in jsp
online examination system project in jsp  thanks for providing me 6 tables for online examination system. I want to know what will the id field of Answers1 table contain? Will it contain same id for all the questions of Set1 &
online examination system project in jsp
online examination system project in jsp  Thanks for providing me the 6 tables.But I want to know will the id field of answers1 table be same for all questions of Set1? Will it be 1 or will be 1,2,3,... What
Online Quiz Application in JSP
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
Using Servlets, JSP for Online Shopping
Using Servlets, JSP for Online Shopping  What is wrong with my code ? JSP <form action="LoginServlet "method="post" > <table> <tr ><td>Username:</td><td><input type="text" name="Id
ex. connect to Oracle - Java Beginners
ex. connect to Oracle  dear sir, I want to ask how to connect java...); e.printStackTrace(); } catch(SQLException ex){ System.err.println("SQLException information"); while(ex!=null) { System.err.println
online shopping project in j2ee - JSP-Servlet
online shopping project in j2ee  hello, I am doing a project on online shopping implementing it with only jsp-servlet.I wanted to know that do I need... might not notice) or just the servlet-jsp is enough?? Thanks in advance
online shopping project in j2ee - JSP-Servlet
online shopping project in j2ee  hello, I am making a project online shopping using jsp-servlet. I wanted to know that how do I implement following: 1) A non-registered user(or a registered user who has not signed-in) can browse
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity... in online connectivity ---- Class.forName
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity... following code in online connectivity ---- Class.forName
online database connectivity issue from JSP page .
online database connectivity issue from JSP page .  Hi; Everything working fine in localhost , but facing a simple problem in connectivity... in online connectivity ---- Class.forName
CAN U HELP ME TO CODE IN JSP FOR ONLINE VOTING SYSTEM
CAN U HELP ME TO CODE IN JSP FOR ONLINE VOTING SYSTEM  can u help me to code in jsp for online voting system
online test project on java using servlets and jsp
online test project on java using servlets and jsp  as i am doing online test project on java using jsp and servlets ,,,the problem is in the code of jsp file which i have sent,...,i used next and previous buttons and used two
Failed to run Online Quiz Application in JSP - JSP-Interview Questions
Failed to run Online Quiz Application in JSP   Hi, I have been following your following link to run the online quiz application, but I failed... your question. Thanks  Hi, I cannot run your online quiz
code to send sms alerts using jsp online
code to send sms alerts using jsp online  I am new to mobile aplication development. pls send me the code for sms alerts after clicking the button
wt are the futures in jdk 1.5 with clear ex
wt are the futures in jdk 1.5 with clear ex  plese send me the correce ex
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
Ask JSP questions online
Ask JSP questions online       Facing problem in JSP? Ask to us, we... new section, you can ask any query relating to JSP, whether it is from
How do i get the number of online users from a site using jsp?
How do i get the number of online users from a site using jsp?  Hi, Can any one tell me how to get the number of records from a database dynamically, when each person got logged into the page in jsp
online shopping
online shopping   Hai sir/madam, i'm working on online shopping project.requirements is oracle10g,servlets/jsp... what is the difference b/w storing and saving image into database.how to store and how
online address book
online address book  how to create online address book using jsp and mysql
online bus reservation
online bus reservation   online bus reservation using jsp coding
Online test
Online test   I am creating a project for online test system. There should be a timer,on pressing next button it will retrieve a next question... and that result will also store in the database.The code must be in JSP-SERVLET using
online voting
online voting  can i have the code for online voting in java
online bookbank
online bookbank  Need online book bank with mvc architecture
online voting
online voting  can i have the code for online voting in java
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...: http://www.roseindia.net/jsp/online-quiz-application-jsp.shtml
online shopping
online shopping  hi, i am doing online shopping project i want to do online payment. How it can be possible
online shopping - Java Beginners
online shopping  Respected Sir, Sir please help me how to handle online shooping and shopping cart by click on image by only using jsp
online exam
online exam  how we can upload the data on the server using any site
online exam
online exam  how we can upload the data on the server using any site
Advertisements
 

 

 

DMCA.com