Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Date-Calendar doubt about retrieve dates from Database
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


pavithra kannan
doubt about retrieve dates from Database
3 Answer(s)      6 years and 7 months ago
Posted in : Date-Calendar


Retrieve dates from the database with some condition in dates in JSP


Advertisement
View Answers

February 27, 2008 at 9:16 PM



i want to retrieve datas from the database with some condition in dates in jsp



February 28, 2008 at 3:20 PM


Retrieve data from Database using JSP

JSP Example Code for retrieving Data from Database
<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>
<html>

<head>
<title>Date retrive value from database</title>
</head>

<body>

<table border="1" width="50%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<h1><center>Date retrive value from database</center></h1>
<form method="POST" >

<table border="1" width="100%" cellspacing="0" cellpadding="0">

<tr>
<td width="50%" valign="right"><b>Date:</b></td>
<%

Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
java.util.Date date;
String s=null;
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"root","root");
try{
Statement st = con.createStatement();
DateFormat dformat = new SimpleDateFormat("yyyy-MM-dd");
try{
date = new java.util.Date();
s = dformat.format(date);
// out.println("Today = " + s);
}
catch(Exception e){
e.getMessage();
}
String query = "SELECT date FROM user_details where username='amardeep'";
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
// out.println(rs.getString(3) + "<br>");%>
<td width="50%" valign="right">
<%=rs.getString("date")%><br/></td>

<%}
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>


For more JSP and Servlet Example codes

Inserting Data into Database using JSP
http://www.roseindia.net/answers/viewanswers/272.html

Storing Date into database
http://www.roseindia.net/answers/viewanswers/304.html

Neelam ;)


February 28, 2008 at 3:21 PM


Retrieve data from Database using JSP

JSP Example Code for retrieving Data from Database
<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>
<html>

<head>
<title>Date retrive value from database</title>
</head>

<body>

<table border="1" width="50%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<h1><center>Date retrive value from database</center></h1>
<form method="POST" >

<table border="1" width="100%" cellspacing="0" cellpadding="0">

<tr>
<td width="50%" valign="right"><b>Date:</b></td>
<%

Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
java.util.Date date;
String s=null;
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"root","root");
try{
Statement st = con.createStatement();
DateFormat dformat = new SimpleDateFormat("yyyy-MM-dd");
try{
date = new java.util.Date();
s = dformat.format(date);
// out.println("Today = " + s);
}
catch(Exception e){
e.getMessage();
}
String query = "SELECT date FROM user_details where username='amardeep'";
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
// out.println(rs.getString(3) + "<br>");%>
<td width="50%" valign="right">
<%=rs.getString("date")%><br/></td>

<%}
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>


For more JSP and Servlet Example codes

Inserting Data into Database using JSP
http://www.roseindia.net/answers/viewanswers/272.html

Storing Date into database
http://www.roseindia.net/answers/viewanswers/304.html

Neelam ;)


Related Tutorials/Questions & Answers:
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
Advertisements
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
retrieve from database........
retrieve from database........  <p>hi i am not able to retrieve string from database to a text box in web page my code is as follows:-</p>...("username"); re=stmt.executeQuery("select * from userreg where username='"+username
how to retrieve data from database
how to retrieve data from database  unable to retrieve data from database using mySQL by using jsp sessions and beans for editing
How to retrieve image from database
How to retrieve image from database  hi........ How to retrieve image from database when it is stored. I have stored image in postgresql and want to retrieve in java form. Can u tel me hw to do? I am trying n able to do also
retrieve data from database with hyperlink
retrieve data from database with hyperlink  sir....i have one table called 'name' having two values i have to retrieve those data with a hyperlink... have values C C++ i have to retrieve and if i click C its sub categories should
Retrieve date from MYSQL database
Retrieve date from MYSQL database In this tutorial, you will learn how to retrieve date from database. Storing and Retrieving dates from the database is a common task. MYSQL provides different ways of inserting and fetching dates from
retrieve data from mysql database
retrieve data from mysql database  hi am not familiar in php.....even... selected value on combobox which is to be retrieve the relevant data from mysql database using php.... below my code is that.. <html> <head>
Data retrieve from mysql database
Data retrieve from mysql database  Hi sir, please give some example of jsp code for retrieving mysql database values in multiple dropdown list... from the dropdown, related data will get displayed on the textboxes. Here we have
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
how to use bean to retrieve data from database
how to use bean to retrieve data from database  how to use bean to retrieve data from database   poda sendru
Retrieve multiple data from database into Table.....
Retrieve multiple data from database into Table.....   hi........... I want to Retrieve multiple data from database into Table but i am not able to.... i am only able to retrieve one value not more than that. means in my
retrieve data from database using jsf
retrieve data from database using jsf  Hello I want an example of source code to retrieve data from database i have a database (oracle) name as db1...),, name ,and city I want after enter value in textbox according idauthor i retrieve
Retrieve values from database using views
Retrieve values from database using views  hi......... I have a huge database so i have created views in database where i am selecting only the columns which are required. As my front end is java swings i want to retrieve data
Retrieve value of radio button from database to form
Retrieve value of radio button from database to form  var gn=document.getElementsByName("empg"); //empg is name of radio input type. for(var i=0;i
Dropdown code to retrieve result from oracle database
that will retrieve values from the database into dropdown. As the user choose any option...Dropdown code to retrieve result from oracle database  Hi Friends, I... retrieve the result from Oracle database.We have procedures created already.Just
how to store and retrieve image from database
how to store and retrieve image from database  how to store and retrieve images into database(oracle) and how to retrive images from database using jsp   Here is a jsp code that insert and retrieve image from mysql
retrieve data from mysql database and store it in a variable ?
retrieve data from mysql database and store it in a variable ?  sir... that retrieve the integer values from the database and stored in the integer variables. In addition to it, we have added numbers that are retrieved from
doubt about J2EE connetivity
doubt about J2EE connetivity  steps to connect J2EE components with MYSQL
Retrieve data from database in swing application
Retrieve data from database in swing application  I want to retrive data(doctor name,specilization,date) from my sql database...(); ResultSet rs=st.executeQuery("select * from data where id=1"); while
how to retrieve images from database to jsp?
how to retrieve images from database to jsp?  Hi sir,i want to stores images along with the name and price with database and retrieve it on jsp.and...=con.createStatement(); String strQuery = "select * from data"; ResultSet rs
how we retrieve image from database
how we retrieve image from database  my code is:- $search=$_POST... from mysql database: <?php mysql_connect("localhost","username","password... not connect to Database"); $query = "SELECT content,size,type FROM upload WHERE id=1
retrieve the data to text fields from database on clicking the value of combo box
retrieve the data to text fields from database on clicking the value of combo box   retrieve the data to text fields from database on clicking... getting data into textarea from database table by clicking on the button
<img src=""> using retrieve image from database using jsp
using retrieve image from database using jsp  how to <img src="" > tag using retrieve image from database and display in jsp
how to store and retrieve images int and from the database using php
how to store and retrieve images int and from the database using php  please anyone can help me in storing the images and retrieve it back from the Mysql database using php
retrieve value from database on the basis of maximum id number
retrieve value from database on the basis of maximum id number  hi, i want to retrieve value of maximum id number from the database and show that value in jTextField.when the user clicks on the button that maximum id number
How to Retrieve Data from the database and write into excel file using Java
How to Retrieve Data from the database and write into excel file using Java  Hi, I am trying to develop an small application where i trying to retrieve Data from the database and store the details in excel file. Please can
Doubt about Xstream Converter
Doubt about Xstream Converter  Hi, I am using the Xstream freamwork to read a lot of files in a batch operation. I use a custom converter Xstream to read some properties of my Xml file, but when I changed my application
doubt about JMS selector
doubt about JMS selector  Hi! , i have a little problem with message selector in JMS api. I'am try develop a request and response with JMS queue, but I didn├?┬┤t get success. in my case, i send a message to server, server
 

 

 

DMCA.com