Solve it



Share on Google+Share on Google+

Ragini Shukla
Solve it
3 Answer(s)      8 years ago
Posted in : Java Beginners
View Answers

August 26, 2009 at 1:42 PM

Hi Friend,

We have taken student_id=1.According to this id, we are retrieving the data.


package form;
import java.sql.*;
import java.util.*;

public class DBOperation
List dataList = new ArrayList();
Connection con;

public void connect() throws Exception{
try {
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root";);
catch (ClassNotFoundException e) {
public List getExamInfo()

Statement stmt = con.createStatement();
String query="select subject,marks,exam_date,exam_timing,exam_controller,exam_conducted_by,exam_supervision_by,percentage,remarks,exam_type from exam where student_id=1";
ResultSet rs=stmt.executeQuery(query);

catch(Exception e)
return dataList;

August 26, 2009 at 1:46 PM



<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<jsp:useBean id="test" class="form.DBOperation" />
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.style1 {
font-family: "Times New Roman", Times, serif;
font-weight: bold;
.style3 {font-family: "Times New Roman", Times, serif}
<form name="form" action="" method="post">
<table align="center" width="50%" border="0" cellspacing="10" cellpadding="0">
<td height="30" valign="middle" bgcolor="#DA0C12"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<td width="34%" align="center"><h3><span class="white_text">&nbsp;Welcome to Binsys Technologies </span></h3></td>
<td width="16%" align="center" class="white_text"><a href="jsps/logout.jsp"> Logout</a></td>
<td align="center" valign="top"><!--<div style="height:320px; width:754px; overflow:auto;"> -->
<table width="736" border="0" cellspacing="1" cellpadding="2">
<%test.connect ();
Object sub="";
Object mar="";
Object exam_da="";
Object exam_ti="";
Object exam_cont="";
Object exam_con="";
Object exam_supervision="";
Object percent="";
Object remark="";
Object exam_ty="";
Iterator itr;
List data= test.getExamInfo();
for (itr=data.iterator(); itr.hasNext(); ){;;;;;;;;;;
String subject=sub.toString();
String marks=mar.toString();
String exam_date=exam_da.toString();
String exam_timing=exam_ti.toString();
String exam_controller=exam_cont.toString();
String exam_conducted_by=exam_con.toString();
String exam_supervision_by=exam_supervision.toString();
String percentage=percent.toString();
String remarks=remark.toString();
String exam_type=exam_ty.toString();

August 26, 2009 at 1:47 PM


<td width="19%" align="left" bgcolor="#F4F4F4"><span class="style3">Exam Type</span></td>
<td width="26%" align="left" bgcolor="#F4F4F4"> <input type="text" name="exam_type" class="input" value="<%=exam_type%>"> </td>
<td width="25%" align="left" bgcolor="#F4F4F4">Subject</td>
<td width="30%" align="left" bgcolor="#F4F4F4"><input type="text" name="subject" class="input" value="<%=subject%>"> </td>
<td width="19%" align="left" bgcolor="#F4F4F4"><span class="style3">Exam Date </span></td>
<td width="26%" align="left" bgcolor="#F4F4F4"><input name="exam_date" type="text" class="input" value="<%=exam_date%>" /></td>
<td width="25%" align="left" bgcolor="#F4F4F4"><span class="style3">Exam Timing</span></td>
<td width="30%" align="left" bgcolor="#F4F4F4"><input name="exam_timing" type="text" class="input" value="<%=exam_timing%>" /></td>
<td width="19%" align="left" bgcolor="#F4F4F4"><span class="style3"> Marks</span></td>
<td width="26%" align="left" bgcolor="#F4F4F4"><input name="marks" type="text" class="input" value="<%=marks%>"/></td>
<td width="25%" align="left" bgcolor="#F4F4F4"><span class="style3">Exam Controller</span></td>
<td width="30%" align="left" bgcolor="#F4F4F4"><input name="exam_controller" type="text" class="input" value="<%=exam_controller%>"/></td>
<td align="left" bgcolor="#F4F4F4"><span class="style3">Exam Conduct By</span></td>
<td align="left" bgcolor="#F4F4F4"><input name="exam_conducted_by" type="text" class="input" value="<%=exam_conducted_by%>"/></td>
<td align="left" bgcolor="#F4F4F4"><span class="style3">Exam Supervision By</span></td>
<td align="left" bgcolor="#F4F4F4"><input name="exam_supervision_by" type="text" class="input" value="<%=exam_supervision_by%>"/></td>
<td width="19%" align="left" bgcolor="#F4F4F4"><span class="style3">Percentage</span></td>
<td width="26%" align="left" bgcolor="#F4F4F4"><input name="percentage" type="text" class="input" value="<%=percentage%>"/></td>
<td width="25%" align="left" bgcolor="#F4F4F4"><span class="style3">Remarks*</span></td>
<td width="30%" align="left" bgcolor="#F4F4F4"><TEXTAREA NAME="remarks" COLS=20 ROWS=6 ><%=remarks%></TEXTAREA>

Hope that it will be helpful for you.


Related Tutorials/Questions & Answers:
Solve it
Solve it  How to calculate the value which contains oparator and operand both using command line argument
solve this
solve this   Create a student class. The student object should have studentid, studentname, subject and marks as properties. Also generate the getter and setter methods. Create 5 objects of this class and populate values
solve this pbm
solve this pbm  its not working the code for databae access using servlets
how to solve
how to solve   log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources). log4j:WARN Please initialize the log4j system properly
solve this pbm
solve this pbm  sir rows are also inserting i have checked in the database also the rows are not affected in the table . The first pbm wich i have sent to you is not yet solved.......... pls give me detail explaination how we
how to solve this..
how to solve this..  Given a list of students and their marks Name | Science | Math | English | Computer Ahmad | 28 | 100 | 66 | 34 Samad | 56 | 89 | 55
how to solve this..
how to solve this..  Given a list of students and their marks Name | Science | Math | English | Computer Ahmad | 28 | 100 | 66 | 34 Samad | 56 | 89 | 55
solve this problem
solve this problem  I typed this program and compiled.The program is compiled but when i eneterd url in tomcat server. Its not giving error but only blank page is coming the text is not displaying and row is also inserted
A Program To Solve In Java
A Program To Solve In Java  x!/x+(x+2)!/x+(x+4)!/x ... (x+n)!/x
help me to solve this question
help me to solve this question  Write a program that inputs a series of integers into an array. The numbers are in the range 0 to 100. Calculate and display : a) The Largest number b) The Smallest Number c)The sum of the numbers
please solve this program
please solve this program  Build a package EMPPACK that contains one stored function Validatesal() and two stored procedures Insertemp() and Getempdetails().The Insert_emp() procedure inserts a particular employee
please solve the programme
please solve the programme  Develop a java program to find the roots of a quadratic equation ax2+bx+c=0, with the following specification :- Class name :- Quad Data members float a,b,c,d, with a,b,c are the co-efficient
Solve Program - Java Beginners
Solve Program  Write a progaram in java to display all odd number from 1 to 100   hi use this code package rajanikant.code.sep_2008; public class EvenOdd { public static void main(String s
help me to solve this question...
help me to solve this question...  Given below is a class definition for Book. Type and compile the class, and answer the following questions: class Book { String title; //bookâ??s title double price; //bookâ??s
help me to solve this problem..
help me to solve this problem..  Given below is a class definition for Book. Type and compile the class, and answer the following questions: class Book { String title; //bookâ??s title double price; //bookâ??s price
plz solve my query?
plz solve my query?  how to remove all the options from select control in html using java script?   JavaScript remove all items <html> <script language="javascript" > function removeAllItems(selectbox
Solve it - Java Beginners
Solve it  Hi Friends, Thanks for continue reply.. I have some query please solved...its urgent.. I have two table,emp,exam.both have e... is write here. no information display in the jsp file please solve it and let me
Solve this problem plzzz
Solve this problem plzzz  Prashant.jsp (this is my JSP file) <HTML> <HEAD> <TITLE>Login using jsp <BODY>... kindly help me and check all those files and solve my problem as soon as possible
How to solve the Hibernate Common Exceptions?
How to solve the Hibernate Common Exceptions?  How to solve the Hibernate Common Exceptions
solve it - Java Beginners
solve it  Hi friend, I want to use switch case in jsp please let me know how to call page in jsp using include tag i want call this file using include tag please help me use switch statement in jsp
ArrayList question plz solve it
ArrayList question plz solve it  An arraylist object stores an Emp Object, where there is name,age,address of the employee is stored, And i want to access the data in the basis of age based? Provide answer to the question
Solve my code
Solve my code  import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import*; public class ChangeDetails extends HttpServlet{ public void doPost(HttpServletRequest request,HttpServletResponse
to solve the error - Java Beginners
to solve the error  class bubbleSort1{ public static void bubbleSort(int[] x) { int n = x.length; for (int pass=1; pass < n; pass++) { // count how many times // This next loop becomes shorter and shorter for (int i=0
help me to solve this question
help me to solve this question   A user needs to key in data into system in order to save data into array. The data are: a. Lecturer ID, Lecturer name, School, course code, course name, session, semester A user can edit the data
solve my question shortly
solve my question shortly  <html> <head> <script> function checkphoneNumber(number){ if(/[^\d ]/.test(number)){ alert('It should contain numbers [0-9] only!'); document.getElementById
I couldn't solve it
I couldn't solve it  *A customer who wants to apply for getting a car license should provide information about the brand of the car. *Then the customer receives a request ID from the office. *The customer's request (represented
plz help meto solve this question
plz help meto solve this question  for a file that exist what will be the length() method in the file class return
i dont no how to solve it pls
i dont no how to solve it pls   Calculate and display the sum of all prime number from 1 to 100 covert in java system codes
how to solve an internet connection problem
how to solve an internet connection problem  when i run my application it give me this error: Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not yet implemented the problem is that i don`t know
can interface solve this problem in java
can interface solve this problem in java  I have a JDialog which displays the calendar [from 2010-2020], i created this in a different class... this calander class. can interface solve this problem. If yes then how. pls


Advertisement null