Home Answers Viewqa JDBC Help on JSP and JDBC

 
 


Manoj Kumar Singh
Help on JSP and JDBC
2 Answer(s)      5 years and 2 months ago
Posted in : JDBC

Retrieve data from Database in JSP and JDBC connection.

View Answers

April 2, 2008 at 8:51 PM


retrivedata.jsp

<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>
<html>
<head>
<title>Retrive value from database</title>
</head>
<body>
<table border="0" width="50%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<h2><font color="#FF0033">Retrive data from database</font></h2>
<form method="POST" >
<table border="1" width="50%" cellspacing="0" cellpadding="0" bgcolor="#66FFCC">
<tr>
<td width="50%" valign="right"><b>ID</b></td>
<td width="50%" valign="right"><b>Employee Name</b></td>
<td width="50%" valign="right"><b>Position</b></td>
<%
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"root","root");
try{
Statement st = con.createStatement();
String query = "SELECT * FROM emp_details";
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
%>

<tr>
<td width="50%" valign="right"><%=rs.getInt("empno")%></td>
<td width="50%" valign="right"><%=rs.getString("empname")%><br/></td>
<td width="50%" valign="right"><%=rs.getString("job")%><br/></td>
</tr>
<%
}
rs.close();
con.close();
}
catch(SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}
%>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>

April 8, 2008 at 4:04 PM


hi friend,
jsp only for view , we should use for presentation don t combine databse code and jsp, it is not good approach,use separate class for connection from that class get values.

jsp only for view , even html designers can do this, we are java programmers keep mind









Related Pages:
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
Help on JSP - JDBC
Help on JSP  Sir I am makeing a project name Online reservation and Enquiry system. I had completed the front end design with the help of html,delete and search the database from the html file with the help of JSP.  hi
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... happening for my update query. Please help me with a suitable suggeastion. Regards Sreejith  send me your jsp coding then i can understand what
jsp - JDBC
jsp  My code is not working please anyone help me to store retrieved... variable. JSP Page... Login Successful <%-- <jsp:forward page="studenthome.jsp"/>
jsp - JDBC
JSP Storing Data, Datatype vale in SQL   Storing Data, Datatype vale...;<%Connection con = null; String url = "jdbc:mysql://localhost:3306..., will help you in storing date in sql database.See how to insert data from html
jdbc - JDBC
in JSP to create a table. 2)how desc can be written in JDBC concepts  Hi friend, Code to help in solving the problem : import java.sql.... = null; String url = "jdbc:mysql://localhost:3306/"; String db
JSP and JDBC - JSP-Servlet
JSP and JDBC  Respected sir/Madam, I am R.Ragavendran.. I... for JDBC codings must be present.. NOTE: When User clicks Insert,for example...; IF I GET THIS HELP IN TIME.... Thanks/Regards, R.Ragavendran.
JSP-Servlets-JDBC
be JSP-->Servlet-->JDBC-->Services-->JSP 3, Update - The table created... if we give the form ID in a JSP and submit delete. Please help me...JSP-Servlets-JDBC  Hi all, 1, Create - i want sample code
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... Semester.   Hi friend, Code to help in solving the problem
Displaying Date in jsp - JDBC
in a database.i am getting input value from HTML and i use jsp application to interact with database.My JSP code for inserting Date is below: String dateStr... tells cast needed for java.util.Date to java.sql.Date.Will you help me?  
Servlets and Jsp - JDBC
Servlets and Jsp  Sir I am getting Nullpointer exception in netbeans ,while running this program. Please help me. http://www.roseindia.net/mysql/select-box.shtml
Servlets And Jsp - JDBC
Servlets And Jsp  Sir, I need a program for when i select the one of the field name of table,It has to display the table.Please anyone help me.I need this program fully
servlets and jsp - JDBC
servlets and jsp  I want to display textboxes dynamically in my page using JSP and servlets (javascript for validation). For eg, consider... it in mysql table. Kindly help me, Thanks in advance
Frame with JDBC - JDBC
; Hi,Do you want to display the data on JSP Page?If yes then following tutorial might help you:http://www.roseindia.net/jdbc/jdbcconnectivity.shtmlThanks
servlets And Jsp - JDBC
only has to be added in the table .other field has to be set as null.Please help... so that we can provide help to you. Thanks RoseIndia Team
Programming Help URGENT - JSP-Servlet
Programming Help URGENT  Respected Sir/Madam, I am..., connection for JDBC codings are present.. NOTE: When User clicks Insert,for example... TO ROSEINDIA TEAM< IF I GET THIS HELP IN TIME.... Thanks/Regards
help!!!!!!!!!!!!!!!!!!
help!!!!!!!!!!!!!!!!!!  /import java.awt.; import java.sql.*; import... con =DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root..."); Connection con =DriverManager.getConnection("jdbc:mysql://localhost:3306/test
help in insert code - JSP-Servlet
help in insert code  I have some doubt in following code. I want... package.can u plz help me out.  hiimport java.io.*;import java.sql.*;import... = response.getWriter(); Connection con = null; String url = "jdbc:mysql
jdbc
how to connect JSP page to database - JDBC  how to connect JSP page to database ?give program
JDBC
JDBC save a data in the database  I need a code to save a data in the database can anyone help?   The given code set up the connection between java and mysql using JDBC and saves the data into the database. import
JDBC
JDBC code to save a data in the database  I need a code to save a data in the database can anyone help?   The given code set up the connection between java and mysql using JDBC and saves the data into the database
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
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 help
JSP help  Hi i am using jsp,html and mysql. I am displaying one question & their 4 options per page. For that i have one label for question &... do this? Please Help
JDBC Training, Learn JDBC yourself
will help the programmers to learn JDBC skills necessary to build powerful... that help you in understand JDBC connection timeout.   JDBC... a code that help you in understand to explain JDBC Execute Statement.  
JSP,JDBC and HTML(Very Urgent) - JSP-Servlet
JSP,JDBC and HTML(Very Urgent)  Respected Sir/Madam, Thanks... details from database using JDBC and JSP. The home page i.e HTML Page must contain... the code: I am not using any html. I used only jsp & jdbc. HOme Page
JDBC
retrieve the value from database into dropdown list using JDBC SQL 2005  How to retrieve the value from database into dropdown list using JDBC & SQL 2005?   JSP Code: Create table country(country_id,country
jsp help
jsp help  Hi i am doing my project in jsp.using netbeans 6 and mysql 5.0. and i managed to complete it. and now its submission time. but am confused... with it. so that my project can run independently in any server. plz help me. am so
jdbc
logical group of data with a number of columns. JDBC ResultSet Example Stored... traffic and improve performance. Stored procedures can be used to help ensure
java - JDBC
of a field as a request (from the middle of the jsp page or html page) to the server...(jdbc)).... please......It's very important and urgent....  Hi friend, I am sending a link. I hope that, this link will help you. Following
html - JDBC
it will help to solve your problem. http://www.roseindia.net/jsp/dynamic-page...html  How to insert a new column into HTML (or jsp) table dynamically... jsp but i am not able to print them on the table because table columns
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
jdbc-jsp
jdbc-jsp   your info mail your info mail Name password Address tel no sex country India Canada france America I... into database using jsp
Jdbc
Jdbc  HI!I am trying to connect to oracle 10g from a servlet but keep getting "Internal server error" when trying to run the servlet.I am using eclipse galileo and tomcat 5.5.Can anyone help asap?please
java - JDBC
java  I am using sessions (in JSP) in my project,for login and other purposes. I am using tomcat 5.0,oracle,jsp in my project. Project.... Its very urgent and important.......plz ,,,,,,,,help me
Help on JDBC and my SQL 5 database - JDBC
Help on JDBC and my SQL 5 database  Dear Sir, I had create a statement for the JDBC as shown below: try... the connection c = DriverManager.getConnection ("jdbc:mysql
connectivity - JDBC
) org.apache.jsp.gui1_jsp._jspService(gui1_jsp.java:142...(DriverManager.java:171) org.apache.jsp.gui1_jsp._jspService(gui1_jsp.java:70........ thanks in advace to those who gonna help me........  Hi friend
jsp - JDBC
jsp  -------------------------------------------------------------------------------- how to receive data into jsp from html for dropdown boxes
java - JDBC
of table on a html page or jsp ? plz.., it's very important to my final year project  Hi friend, Code to help in solving the problem : import... conn = DriverManager.getConnection("jdbc:oracle:thin:@training:1521:Oracle
java - JDBC
java  How to connect java(jsp) and oracle8i? plz, explain every step included in the process. It's urgent..  Hi friend, Code to help... oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection("jdbc
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
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
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  how to link jsp code with next htmlcode.  Hi keerthi, Can u explain ur question clearly? What is your exact Requirement
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
jdbc - JDBC
can use following code to connect to Database with the help of JDBC API... management so i need how i can connect the pgm to database by using jdbc...? if u replyed its very useful for me...  Hi, Please read JDBC tutorial
JDBC - JDBC
JDBC  JDBC driver class not found:com.mysql.jdbc.Driver..... Am... the server lib folder but still itd getting me the error..... Can anyone help... path. For read more information on JDBC visit to : http
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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.