How to get the data from the database using Servlet or JSP program
hello My Netizen friend has given the answer to retrieve data from the database by using servlet or jsp program by typing the output as like this below ReusltSet rs=statement.executeQuery("select * from Table1) while(rs.next()) { out.println(rs.getInt(1)); out.println(rs.getString(2)); out.println(rs.getString(3)); out.println(rs.getInt(4)); } But still i am not gettin the output from the Browser.
Actual problem is that i have a simple program in jsp in the sense to get data from the database like oracle . I have created one jsp program like this
<@ page session="false"%> <@ page import="java.io.*" import="java.sql."%> <%try { PreparedStatement ps; Connectin con; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DrivergetConnection("jdbc:odbc:DNSName","scott","tiger"; ps=con.prepareStatement(); ResultSet rs=ps.executeQuery("select from Table1"); if(rs.next()) { out.println(rs.getInt(1)); out.println(rs.getString(2)); out.println(rs.getString(3)); out.println(rs.getInt(4)); } } catch(Exception e) {} rs.close(); ps.close(); con.close(); %>
But now when i iam saving this program in JSP it is alright , when i opened the Tomcat and getting the necessary path then i clicked on the JSP file i,but i am not getting any thing in the internet Browser.i have given the data (Table1) in the database.so that data should come on the Browser. but not getting.So kindly the RoseIndia netizens help to solve the problem
View Answers
October 20, 2011 at 3:24 PM
Related Tutorials/Questions & Answers:
Advertisements
How to get data from Oracle database using JSP the answer to retrieve
data from the
database by
using servlet or
jsp program...
How to
get data from Oracle
database using JSP hello i have a simple problem in
jsp in the sense to
get data from the
database like oracle . I have
how to get data from database into dropdownlist in jsphow to
get data from database into dropdownlist in jsp Can anybody tell me what is the problem in this code as i am not able to fetch the
data from... tutorial go through the link
JSP Get Data Into Dropdown list
From Database
how to get data from checkboxes - JSP-Servlethow to
get data from checkboxes hi,
i got list of tables on screen by invoking webservices.when the user selects the tables by
using checkboxes, i need to
get only those tables to the next page where i can
get list of columns
Acees data from database using combo box - JSP-ServletAcees
data from database using combo box please let me
how i access the
data from database when i select combo box combo2 having values Arts... value 11 or 12, otherwise combo box combo2 remain hide.
Here is
JSP's files
JSP Get Data From DatabaseJSP Get Data From Database
In this section we will discuss about
how to
get data from database using
JSP.
To
get data from database to a
JSP page we... giving a simple example which lets you understand to fetch
data
from database fetch record from oracle database using jsp-servlet?fetch record
from oracle
database using jsp-
servlet?
how can i fetch
data from oracle
database by
using jsp-
servlet. i'm
using eclipse, tomcat server and oracle
database and creating
jsp pages and also
using servlet how to display a table from database using servlethow to display a table
from database using servlet
how to display... the following link:ADS_TO_REPLACE_1
http://roseindia.net/
jsp/
servlet-
jsp-
data... the following link:
http://roseindia.net/
jsp/
servlet-
jsp-
data-list.shtml
ThanksADS
data are not display in JSP from database - JSP-Servletdata are not display in
JSP from database
i want to finding some
data through a SQL query
from SQL server
database to a
JSP page based on some... of this
jsp page. like..
School Result
and three request parameters 'class', '
from get info from mysql using jsp and servletget info
from mysql
using jsp and servlet HELLO! I wanna create a
jsp page which able to let me
get its name, phone and other info by asking the user to key in their email address
from mysql
database by
using servlet and
jsp too
retrive data from database using jsp in struts? retrive
data from database using jsp in struts? *search.jsp*
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<... searchProduct(SearchDTO sdto) {
String query="select *
from product
JSP Get Data Into Dropdown list From DatabaseJSP Get Data Into Dropdown list
From Database
In this section we will discuss....
This tutorial explains you that
how to fetch
data from database and set... for fetching
data from the
database and set
it into the dropdown list in
JSP retrieve related data from database using jsp and mysqlretrieve related
data from database using jsp and mysql Hi sir,
please give some example of
jsp code for retrieving mysql
database values in multiple dropdown list. if we change a value in a dropdown its related value must
How to get the output of JSP program using BeanHow to
get the output of
JSP program using Bean Hi
Kindly go...
program for the above one by
using Bean and i opened the Tomcat webserver... visit the following link:
http://www.roseindia.net/
jsp/
using-bean-counter.shtml
how to insert data into database using jsp & retrivehow to insert
data into
database using jsp & retrive Hello,
I have created 1 html page which contain username, password & submit button. in my oracle10G
database already contain table name admin which has name, password
How to get the output of jsp program using BeanHow to
get the output of
jsp program using Bean Hello my Roseindia netizen has suggested one
program but when i implement the same i am not getting...;
Next i created
JSP program for the above one by
using Bean and i opened
How to show data from database in textbox in jsp How to show
data from database in textbox in
jsp How to show
data from database in textbox in
jsp
Here is an example that retrieve the particular record
from the
database and display it in textbox
using JSP.
<
how to insert data in database using html+jsphow to insert
data in
database using html+jsp anyone know what... = null;
// declare a resultset that uses as a table for output
data from... and
database name. Here machine name id localhost and
database name