Share on Google+Share on Google+

Shridhu Chandel
Programming in JDBC and JSP
1 Answer(s)      8 years ago
Posted in : JSP-Servlet

Ads

View Answers

March 23, 2009 at 12:27 AM


Hi friend,

Code to help in solving the problem :

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

<%
String driver = "org.gjt.mm.mysql.Driver";
Class.forName(driver).newInstance();


Connection con=null;
ResultSet rst=null;
Statement stmt=null;


try{
String url="jdbc:mysql://localhost/student
<user>&password=<password>";
con=DriverManager.getConnection(url);
stmt=con.createStatement();
}
catch(Exception e){
System.out.println(e.getMessage());
}

rst=stmt.executeQuery("select * from student where course='MCA' and study_status='completed' and semester=4");
%>
<html>
<body>
<center>
<h2>Books List</h2>
<table border="1" cellspacing="0" cellpadding
="0">
<tr>
<td><b>S.No</b></td>
<td><b>Student Name</b></td>
<td><b>Student Address</b></td>

</tr>
<%
int no=1;
while(rst.next()){
%>
<tr>
<td><%=no%></td>
<td><%=rst.getString("student_name")%></td>
<td> <%=rst.getString("student_address")%> </td>
</tr>
<%
no++;
}
rst.close();
stmt.close();
con.close();
%>
</table>
</center>
</body>
</html>


Thanks









Related Tutorials/Questions & Answers:
Programming in JDBC and JSP - JSP-Servlet
Programming in JDBC and JSP  Write a program using JDBC and JSP to display the names and addresses of all those MCA students at your study centre who have completed/submitted their theory assignments of all the courses of IV
java programming - JDBC
java programming  Develop a simple OPAC system for library using even-driven and concurrent programming paradigms of Java. Use JDBC to connect to a back-end database.please reply immediately sir
Advertisements
Programming with JSP
Programming with JSP  Write a program using jsp that accepts a course code as input and displays the course title the program to which it belongs
Programming error - JDBC
Programming error  import javax.servlet.*; import...=DriverManager.getConnection("jdbc:odbc:Odsn"); Statement s=con.createStatement(); int x...("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc
java programming problem - JDBC
java programming problem  Hi, Request you to provide the source code in Java for the following programming problem : upload .csv file data into oracle database. please send the solution to [email protected]
Programming with JSP
Programming with JSP  Who will post me the answer
java servlet programming - JDBC
information: http://www.roseindia.net/jsp/fileupload.shtml Thanks  Hi friend, For read more information: http://www.roseindia.net/jsp
servelet and jdbc programming - XML
servelet and jdbc programming  Write a program using Servlet and JDBC for developing an online submission of an examination form. You are required...(); String connectionURL = "jdbc:mysql://localhost/zulfiqar"; Connection
java programming problem - JDBC
java programming problem  Hi, Request you to provide a solution ( analysis & design & unit test plan & code & test criteria ) to the following problem to the following mail id : Problem : upload excel file data into oracle
java servlet programming - JDBC
programming through servlets Thanx   Hi friend, i am sending multiple
jsp programming
convert a pdf file int svg file using pdftron and dishplay in jsp at run time JSP  I am also in trouble is that I want to convert a pdf file int svg file using pdftron and dishplay in jsp at run time. plz guide me n thanks
jsp programming
converting a pdf file to png format using pdftron JSP programming  Hello, I am trouble in converting a pdf file to png format using pdftron. plz guide me, n thanks in advance
Programming - JSP-Servlet
Programming jsp servlet   Couple of examples that can help to start programming jsp servlet
JDBC with JSP
JDBC with JSP  how to get a combo box value and pass it to the java method in a jsp program dynamically, without moving to servlet or next page
Jsp,JDBC - JDBC
Jsp,JDBC  Write a Program using Servlet,JSP, JDBC and XML to create a web application for a courier company to provide an online help in tracking the delivery status of items.  Hi friend, For solving the problem
JDBC in JSP - JDBC
JDBC in JSP  Sir, I got a problem in my jsp page which contains a delete query to delete the fields from MySql DB. The delete query is working.... Regards Sreejith  send me your jsp coding then i can understand what
jdbc,jsp - JDBC
jdbc,jsp   this is my jsp code in this code i have to give hyperlink to database(selected row must be deplay)  Hi keerthi, replace the line
jsp programming - JSP-Servlet
jsp programming  How to retrieve the invoices from the tally to jsp
JDBC in JSP - JDBC
JDBC in JSP   Sir, This is the code showing the problem. regards sreejith
JDBC in JSP - JDBC
JDBC in JSP   Sir, This is the code showing the problem. regards sreejith
jsp-jdbc - JDBC
jsp-jdbc  Hi! html- jsp-jdbc program from the html form where... jsp frequently. I am getting error through request.getParameter(). can you please...="DriverManager.getConnection("jdbc:odbc:ashokdb","scott","tiger"); Statement st
Help on JSP and JDBC - JDBC
Help on JSP and JDBC  Retrieve data from Database in JSP and JDBC...;% Connection con = null; String url = "jdbc:mysql://localhost:3306/"...;hi friend, jsp only for view , we should use for presentation don t
jsp - JDBC
jsp  I have one jsp code.but it is included oracle databse...("oracle.jdbc.driver.OracleDriver"); Connection con = DriverManager.getConnection("jdbc:oracle... = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:oracle","scott","tiger"); I
JSP - JDBC
JSP Store Results in Integer Format  JSP Example Code that stores the result in integer format in JSP  Hi! Just run the given JSP Example...;/b></td><% Connection con = null; String url = "jdbc:mysql
jsp - JDBC
jsp  -------------------------------------------------------------------------------- how to receive data into jsp from html for dropdown boxes
problem in programming - JSP-Servlet
problem in programming  Hi! I am new with jsp. I am facing a problem in programming to calculate the time interval between login time and logout time of user
jsp - JDBC
JSP Storing Data, Datatype vale in SQL   Storing Data, Datatype vale...;<%Connection con = null; String url = "jdbc:mysql://localhost:3306... to sql database using JSP and Servlet here...http://www.roseindia.net/answers
jsp - JDBC
jsp  i am doing project in java using jsp as font end and microsoft access as back end my project airline ticketing reservations how can i give hyperlink to database rows in jsp code.   First
jsp - JDBC
variable. JSP Page... Login Successful <%-- <jsp:forward page="studenthome.jsp"/>...   2)action.jsp: JSP
jsp - JDBC
jsp  how to link jsp code with next htmlcode.  Hi keerthi, Can u explain ur question clearly? What is your exact Requirement
JSP and JDBC - JSP-Servlet
JSP and JDBC  Respected sir/Madam, I am R.Ragavendran.. I am in urgent need of programming from roseindia team.. My requirement... for JDBC codings must be present.. NOTE: When User clicks Insert,for example
Tutorials   
Java Spring Hibernate Struts Training fat image from db fat image from db fat image from db fat image from db unable to get value returned from javascript variable in page How to change image size before adding to mysql using jsp Design a registration.jsp page with input for user registration details Cart Quantity jsp servlet coding issue servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? image pdf marking pdf marking Multiple image upload using JSP Read code from excel sheet and upload into database using JSP Student java about search engine Convert BLOB to PDF and save it to a location how to copy files from remote to local machine using SFTP SSL in java? Like Team viewer Socket and Servert -Jsp how to copy files from remote location to local using java? How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java how to create SOAP based web service in java? how to fetch data from mysql database table and draw a bar chart on that data using in jsp how to create users in LDAP using java? how to authenticate user using TIVOLI api in java? how to create users using IBM Tivoi API in jsp/servelet? Java/J2ee Please explain this code as many packages and classes are unknown to me .! how to download the uploaded folder files using jsp Login Query image is display from path of mysql database please reply the code to store dynamic fields in database? Reloading issue in jsp How to get Button Id ? calling one jap page from another jsp page login login Problem to get connection from DAO class to JDBC Page Loading Time Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below Sending hidden values

Ads

 
Advertisement null

Ads