retrieving from db

retrieving from db

View Answers

July 15, 2008 at 7:15 PM

Hi

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

<html>
<head>
<title>Retrive value from database</title>
</head>
<body>
<table border="1" width="75%" 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="100%" cellspacing="0" cellpadding="0" bgcolor="#CCFFCC">
<tr>
<td width="50%"><b>User id:</b></td>
<td width="50%"><b>Course Name</b></td>
<td width="50%"><b>Courese Fee</b></td>
<td width="50%"><b>Faculty Name</b></td></tr>
<%
Connection con = null;
String url = "jdbc:mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"amar","amar123");
try{
Statement st = con.createStatement();
String query = "SELECT id,coursename,couresefee,facultyname FROM student where id=id";
ResultSet rs = st.executeQuery(query);

while (rs.next()) {
String coun=rs.getString(1);
String coun1=rs.getString(2);
%>
<tr>
<td width="50%"><%=coun%></td>
<td width="50%"><%=coun1%></td>
<td width="50%"><%=rs.getString("couresefee")%></td>

<td width="50%"><%=rs.getString("facultyname")%></td></tr>

<%}

out.println("<br/><a href=RetriveForm.jsp><b>Insert Data page</b></a>");
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>

---------------------------------------

Read for more information.

http://www.roseindia.net/jsp/

Thanks









Related Tutorials/Questions & Answers:
retrieving from db - JSP-Servlet
retrieving from db  hello' I am trying to write my first application...: rst=stmt.executeQuery("select * from books_details"); 27: %> 28...; Hi Retrive value from database Retrive data from
retrieving info from DB using struts?
retrieving info from DB using struts?  Hi. I was looking info about retrieving info from a database using struts. I need a .java that I suppose connects to a database and show the info on a jsp. Somebody could help me
Advertisements
retrieving image from mysql db with standard height and width
retrieving image from mysql db with standard height and width  Hi . Here is my code to retrieve an image from mysql db. Its working properly. But i... = "jdbc:mysql://localhost:3306/"; String dbName = "db"; String userName
retrieving image from mysql db with standard height and width
retrieving image from mysql db with standard height and width  Hi . Here is my code to retrieve an image from mysql db. Its working properly. But i... = "jdbc:mysql://localhost:3306/"; String dbName = "db"; String userName
Retrieving attribute value from XML
Retrieving attribute value from XML  I have an XML as below to parse... snippet is as below: DocumentBuilder db = DocumentBuilderFactory.newInstance...://www.roseindia.net/xml/getting-text-values-from-a-nodel.shtmlADS_TO_REPLACE_3 http
retrieving xml document from database
retrieving xml document from database  Hi Guys, I want to retrieve the xml document stored in the database on to a jsp page using jdbc/odbc connnection.Please help me in implementing this feature. Thank You Madhu
Retrieving specific data from excel
Retrieving specific data from excel  Hello everyone, i have written a simple code to retrieve data from excel sheet and working fine, the excel file... first sheet from the workbook HSSFSheet sheet = workbook.getSheetAt(0
related retrieving value from oracle database
related retrieving value from oracle database  how we get the value from database in the given textbox
related retrieving value from oracle database
related retrieving value from oracle database  how we get the value from database in the given textbox
Retrieving the Image from a database Table
Retrieving the Image from a database Table Consider a case where we want... to retrieve the image from the database table. You can do it very easily after... from the database table our java program need to make a connection
check radio button on retrieving the value from database.
check radio button on retrieving the value from database.  HI i am new to jsp.In my applcation i having a problem. I am retrieving user payment from... checked.If user has done payment through cash then when i am retrieving user
Retrieving Data from Database to fill Combo Box
Retrieving Data from Database to fill Combo Box  Sir, I have a JSP Page with a combo box and a label. I have a database that has two fields id and an image. Now I want to fill the combo box with image and on selecting
Retrieving value from multiple table in database
Retrieving value from multiple table in database  Hi fnds, I want... FROM ( SELECT * FROM month1 UNION ALL SELECT * FROM month2 UNION ALL SELECT * FROM month3 ) AS somealias GROUP BY uname
retrieving of value from excel file - JSP-Servlet
retrieving of value from excel file  Dear sir, Thanks for sending... this message to all the employees when i upload a file then it fetch a data from that excel sheet i.e this matter will take a para meter values from the excel
retrieving of value from excel file - JSP-Servlet
retrieving of value from excel file  Dear sir, Thanks for sending... this message to all the employees when i upload a file then it fetch a data from that excel sheet i.e this matter will take a para meter values from the excel
retrieving of value from excel file - JSP-Servlet
retrieving of value from excel file  Dear sir, Thanks for sending a code now i am getting a particular column value i.e EmailId column for snding a massmails,now i have to get a particular column values i.e Name(A),EL(B
Retrieving JTree structure from database
Retrieving JTree structure from database       This example shows how to retrieving data from... of information from which the user can make single or multiple selections. In list You can
Storing and retrieving data alongwith image in mysql db using jsp
Storing and retrieving data alongwith image in mysql db using jsp  I want to store and retrieve the whole data as shown below in mysql db. I've put... as it is really important for my project????? THIS IS MY DB Table. mysql> use
how to insert list box in java script dynamically and elements retrieving from database like oracle
how to insert list box in java script dynamically and elements retrieving from database like oracle  hi all, how can i insert elements into java script list box retrieving from Database. whenever I insert any element in the Db
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
retrieving values from dynamically added textboxes in jsp - JSP-Servlet
retrieving values from dynamically added textboxes in jsp  hai friends, iam new to this site ,please help me in this senario in jsp how to retrieve values from dynamically added textbox like we can see in naukri.com
retrieving newly added records from mssql database and display in a jsp
retrieving newly added records from mssql database and display in a jsp ... from mssql database table and display those records in a jsp.And i have to delete these 10 records from the jsp and retrieve the next recently added 10 records
Retrieving data from data base using jsp combo box
Retrieving data from data base using jsp combo box  Hi guys please help me , i have on GUI page int that Server type(like apache,jboss,weblogic) one... of the server it has to display the process name from database into the process name
Retrieving Information From Database in JSF Framework - Development process
Retrieving Information From Database in JSF Framework  Requirement : There will be one welcome.jsp in that one button, if we click that button... retrieved from database. see how the datatable in select.jsp should be http
retrieving of data from one jsp to another jsp - JSP-Servlet
retrieving of data from one jsp to another jsp  using jsp i m displaying a table ,in table i m displaying a radio button then values like id,name etc ,if i click on an radio button i have to get a corresponding id value
how to check dates while retrieving data from database
how to check dates while retrieving data from database  i want to update database record based on delivery date i have tried this query but it wont work b="update deliveryorder set prtnm='"+arr[1]+"',stn='"+arr[0]+"',sbston
The code for retrieving data from database into Drop Down List.
The code for retrieving data from database into Drop Down List.  <... to MySQL"); PreparedStatement pre = con.prepareStatement("select * from... = con.prepareStatement("select Quantity from library.booklist where Book = ? "); result
While retrieving text from database onto JSP, the alignment of line and paragraphs is not followed
While retrieving text from database onto JSP, the alignment of line and paragraphs is not followed  I have stored text database through textarea box. While trying to retrieve the same text from db, the text displayed onto
retrieving data from database to the textbox depending upon the id in jsp
retrieving data from database to the textbox depending upon the id in jsp  Hi, our project involves fetching of data from database into textbox... rs=st.executeQuery("select * from item where itemid='"+id+"'"); while(rs.next
graph generation using jfreechart and retrieving values from the database
graph generation using jfreechart and retrieving values from the database ... no. of students.The dsn name is chartdsn. I want to retrieve the data from the access...="org.jfree.data.jdbc.JDBCCategoryDataset"%> <% String query="SELECT * from chart
retrieving data in to the dropdown box from postgresql database in core java
retrieving data in to the dropdown box from postgresql database in core...=st.executeQuery("SELECT role_name from role WHERE dept_id=1234"); if(rs...=con.createStatement(); ResultSet rs=st.executeQuery("select * from student
same thing i want but from db..
same thing i want but from db..  http://www.roseindia.net/tutorial/javascript/dynamicCombo.html same thing i want but from db
View Photo From Db MySql
View Photo From Db MySql  Good Morning Sir, Please help me, I make a small code but i have a error. I want to make viewer photo from database...(); ResultSet res = stat.executeQuery("select * from kar where nik
retrieving from oracle database using jsp combo box
retrieving from oracle database using jsp combo box  hi this is my code in this once i select the server type and version of the server the process name of the server has to display in the process name field from the oracle
how to insert list box in java script dynamically and elements retrieving from database like oracle
how to insert list box in java script dynamically and elements retrieving from database like oracle  Hi, how to dynamically increase size of list box in javascript when elements retrieving from database.. That is whenever I
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc  how to make a radio button selected when retrieving data from database using struts framework and spring jdbc
to upload a table from DB to the same html page
to upload a table from DB to the same html page  how to make this booklist table to be opened in the same html page itself using a third frame
How to access data yearly from DB in C# ?
How to access data yearly from DB in C# ?  how to access data yearly from database in C#. I have code but i m not able to retrieve data yearly from DB table. string date1 = dateTimePicker1.Value.Date.ToString("dd/MMM/yyyy
Read data from Excel and insert in to DB and export data from DB to Excel
Read data from Excel and insert in to DB and export data from DB to Excel  Read data from Excel and insert in to DB and export data from DB to Excel Hi, I need to read the data from excel and I need to insert the same in to DB
how to insert, retrieve data from,to db(code)....
how to insert, retrieve data from,to db(code)....  Hi..... i ve... that data will b stored in db(m using sybase). 2.also hw to retrieve the data from db. cn u plz tel me the code in detail.n i thk it shud b written in jdbc
how to insert, retrieve data from,to db(code)....
how to insert, retrieve data from,to db(code)....  Hi, i have created login page n in that a registration form also in jsp, my doubt is-when new user... will b stored in db(m using sybase). 2.also hw to retrieve the data from db. cn u
Retrieving images from the oracle database using jsp and create that rretrieved image as hyperlink
Retrieving images from the oracle database using jsp and create that rretrieved image as hyperlink  I want to insert images into oracle database.I want to retrieve images using jsp and I want to display on the browser.The
How to insert data from a combobox and textbox values into DB using JSP?
How to insert data from a combobox and textbox values into DB using JSP?  hi, How to insert a comb-box and a text box values in to DB using JSP? @DB... and textbox2? into MYSQL DB
how to retrieve a checkbox value(retrieve from DB)
how to retrieve a checkbox value(retrieve from DB)   I facing... retrieve those value from another database table? the table subject and service... CURRENT SERVICE TABLE IN DB SERVICE TABLE SERVICEID
Retrieving Data From the XML file
Retrieving Data From the XML file  ... is only geared towards showing how to construct a Java object from an XML document.  By this example we are going to get the XML data from the xml file in our
Spring 3.2 MVC insert and retrieve blob from the database
In this section, you will learn about inserting and retrieving blob from the database
Store image from html img tag into mysql db using java
Store image from html img tag into mysql db using java  Hi. How to get the image displayed in the < img > tag of HTML and store it in the mysql database using java? Thanks in advance

Ads