guravharhsa
07-18-2008, 08:07 AM
Hi All,
Kindly give me some guidelines regarding below issue.
I am developing Student feedback system to provide feedback about faculty to in institution.
Now I have three tables in database :
1.Questionid containing column as id, questionid-description, type
2.event table containing column eventid ,eventdescription,questioned-description(contain same data as like questionid-description from Questionid table ) publish , targetgroup.
3.QuestionBank table contain column questionno., questionedid-description(contain same data as like questionid-description from Questionid table),question-name, option-A,option-B, option-c,option-d, and Other.
Now when particular user log in, it will shows welcometoevent.jsp page contains the event-desription from event table which has column publish=’yes’.
When user click on particular event, in next question-fill.jsp it should show all the question available in QuestionBank related to that particular question-id.
The question in multiple choice- form like
1. Question-description
a. option-a
b. option-b like.
Now can any one assist me how to show this variable no. of question with 4-option in question-fill.jsp page page as no. of question for particular event may varies from 20 to 60 .
Here is an my welcomeevent.jsp page showig event with pubish="PUBLISH".
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language ="java" %>
<%@ page import="java.sql.*, javax.sql.*, javax.naming.*,java.io.*,java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome-Event</title>
</head>
<body>
<form name="ServiceTypeListForm" method="post" >
<table width="50%" border="1" borderColor="#000066" cellspacing="0" cellpadding="5" align="center">
<TBODY>
<tr>
<td colspan="8" align="middle" class="StripColor">
<font class="FontGeneralBoldWhite">EVENT TO MARK</font>
</td>
</tr>
<%
Connection connection = null;
Statement st = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mynewdatabase","root", "root123");
st=con.createStatement();
try {
rs = st.executeQuery("Select * from Event where Publish='PUBLISH'");
while ( rs.next() )
{
int id = rs.getInt("Eventid");
%>
<tr class="CellColor">
<td>
<%= id %>
</td>
<td align="center" ahref="/">
<%=rs.getString("Description")%>
</td>
</tr>
<%
}
} finally
{
if (rs != null)
{
rs.close();
rs = null;
}
if (st != null)
{
st.close();
st = null;
}
}
%>
</table>
</form>
</body>
</html>
Kindly assist me.
Thanks and Regards
Haresh
Kindly give me some guidelines regarding below issue.
I am developing Student feedback system to provide feedback about faculty to in institution.
Now I have three tables in database :
1.Questionid containing column as id, questionid-description, type
2.event table containing column eventid ,eventdescription,questioned-description(contain same data as like questionid-description from Questionid table ) publish , targetgroup.
3.QuestionBank table contain column questionno., questionedid-description(contain same data as like questionid-description from Questionid table),question-name, option-A,option-B, option-c,option-d, and Other.
Now when particular user log in, it will shows welcometoevent.jsp page contains the event-desription from event table which has column publish=’yes’.
When user click on particular event, in next question-fill.jsp it should show all the question available in QuestionBank related to that particular question-id.
The question in multiple choice- form like
1. Question-description
a. option-a
b. option-b like.
Now can any one assist me how to show this variable no. of question with 4-option in question-fill.jsp page page as no. of question for particular event may varies from 20 to 60 .
Here is an my welcomeevent.jsp page showig event with pubish="PUBLISH".
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language ="java" %>
<%@ page import="java.sql.*, javax.sql.*, javax.naming.*,java.io.*,java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome-Event</title>
</head>
<body>
<form name="ServiceTypeListForm" method="post" >
<table width="50%" border="1" borderColor="#000066" cellspacing="0" cellpadding="5" align="center">
<TBODY>
<tr>
<td colspan="8" align="middle" class="StripColor">
<font class="FontGeneralBoldWhite">EVENT TO MARK</font>
</td>
</tr>
<%
Connection connection = null;
Statement st = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mynewdatabase","root", "root123");
st=con.createStatement();
try {
rs = st.executeQuery("Select * from Event where Publish='PUBLISH'");
while ( rs.next() )
{
int id = rs.getInt("Eventid");
%>
<tr class="CellColor">
<td>
<%= id %>
</td>
<td align="center" ahref="/">
<%=rs.getString("Description")%>
</td>
</tr>
<%
}
} finally
{
if (rs != null)
{
rs.close();
rs = null;
}
if (st != null)
{
st.close();
st = null;
}
}
%>
</table>
</form>
</body>
</html>
Kindly assist me.
Thanks and Regards
Haresh