Programming in JDBC and JSP

Programming in JDBC and JSP

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
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
Advertisements
Programming with JSP
Programming with JSP  Who will post me the answer
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
jsp programming - JSP-Servlet
jsp programming  How to retrieve the invoices from the tally to jsp
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
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
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 - 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
Programming Error - JSP-Servlet
Programming Error   Place Order function checkName... Orders Delete Orders View Orders Back Jdbc code: import...("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Advdsn
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
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
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 skills - JSP-Servlet
Programming skills  Hi, I visited this site for the first time.It's excellent. I want 2 improve my programming skills.Can u pls help me in making programs using JSP's and servlets.  Hi friend<html><head><
Programming Error - JSP-Servlet
Programming Error  Image: I want that when user clicks on browse button then a folder of images should get open and when user clicks one image... is access). Then how to do this in jsp?? Please Reply me?? Please do Reply
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
Programming Error - JSP-Servlet
Programming Error   Payment Advertisement Management System Payment Premium Position FrontPage BackPage Other Premium Pages... statement in jsp i want to calculate the price of placing ad according to user
Programming Error - JSP-Servlet
Programming Error  Image: Browse When user clicks on Browse Button then a folder of images should get open and when user clicks one of them...("http://localhost:8080/examples/jsp/modify.jsp?filename="+filename
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
java servlet programming - JDBC
information: http://www.roseindia.net/jsp/fileupload.shtml Thanks  Hi friend, For read more information: http://www.roseindia.net/jsp
jsp - JDBC
jsp  -------------------------------------------------------------------------------- how to receive data into jsp from html for dropdown boxes
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
Programming Error - JSP-Servlet
Programming Error  How to validate login page using jsp where it checks for username whether it is empty or not or is it including number or not if it is the paste alert message.   Hi Friend, Try the following
Servlet - JSP Programming - JSP-Servlet
Servlet - JSP Programming  Hi, I'm writing a jsp page as shown below. I have to buttons of type submit. Any time only one is selected(either add to cart or checkout). I'm programming in a servlet getting the input parameters
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... pw = response.getWriter(); String connectionURL = "jdbc:mysql://localhost
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
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
java servlet programming - JDBC
programming through servlets Thanx   Hi friend, i am sending multiple
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
Programming Error - JSP-Servlet
Programming Error   Place Ad Advertisement Management System Create Ad State: City: Main... is it possible in jsp. when user types some thing in draft ad textarea
jsp - JDBC
variable. JSP Page... Login SuccessfulADS_TO_REPLACE_1 <%-- <jsp:forward page...)action.jsp: JSP Page Hello Login SuccessfulADS_TO_REPLACE_2 Login
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
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
jsp  how to link jsp code with next htmlcode.  Hi keerthi, Can u explain ur question clearly? What is your exact Requirement
problem in jsp programming - JSP-Servlet
problem in jsp programming  Write a JSP program which displays a webpage containing arrival of new items within a particular month in the different branches of a retail company.   Hi friend, Code to help
web programming - JSP-Servlet
web programming   Write a JSP page to display the number of hits to this page. (Hint: use application scope of java bean).  Hi Friend, Please visit the following link: http://www.roseindia.net/jsp/simple-jsp
jsp - JDBC
: Unable to compile class for JSP An error occurred at line: 20 in the jsp file...\localhost\Airlines-Project\org\apache\jsp\Flightdetails_jsp.java:69: cannot find symbol symbol : variable src location: class org.apache.jsp.Flightdetails_jsp
jsp - JDBC
about update at http://www.roseindia.net/jsp/implement-javascript
Programming error - JSP-Servlet
Programming error  Register.jsp Registration Form function checkName(text) { if(isNaN(text)){ return 1;} else...=DriverManager.getConnection("jdbc:odbc:Advdsn"); PreparedStatement ps=con.prepareStatement("insert
Programming Error - JSP-Servlet
Programming Error  import javax.servlet.*; import java.io.*; import...=DriverManager.getConnection("jdbc:odbc:Advdsn"); Statement s=con.createStatement(); int x...=DriverManager.getConnection("jdbc:odbc:access"); Statement s=con.createStatement(); int x
web programming - JSP-Servlet
features a.Create a login JSP page with username , password and submit button... to store username and password. c.Open login JSP page on a new browser... the following link: http://www.roseindia.net/jsp/jspcookies.shtml Hope
programming - JSP-Servlet
programming  hello, I am doing online exam project using jsp-servlet... to retrieve next question when click on next button in jsp page and that question will come in same jsp page. please help me how can I do
jdbc-jsp
jdbc-jsp  <html> <head> <title>your info mail</title> </head> <body bgcolor=#FAEBD7> <center><u>... = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root
Programming error - JSP-Servlet
Programming error  Hello Sir, Can u please reply me the code for javamail please actually i watch the javamail.net but i dint understood it. Actually i want to send a mail to my clients with a small text message. Please
programming err - JSP-Servlet
programming err   how to take string from textarea and display output in textbox Please reply me sir . Thank you...  Hi Friend, We are providing you two different codes. For the first one, we have

Ads