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



Home Answers Viewqa JSP-Servlet Displaying date in the preciding code

Have Programming Question? Ask it here!
 
 
 


refilwe
Displaying date in the preciding code
1 Answer(s)      3 years and 5 months ago
Posted in : JSP-Servlet


while deploying the Bill date field on this page are empty though it should be displayed

String userName = request.getParmeter("userName"); String custId = request.getParameter("customerId"); String emailId = request.getParameter("emailId"); String phoneNumber = request.getParameter("phoneNumber"); String[] dateStr = new String[3]; String[] status = new String[3]; try { //Code to connect to the database String sql = "select billid, customerid, billdate, status from customerbills where customer_id=? and status='Paid'"; PreparedStatement stmt = conn.prepareStatement(sql); stmt.setString(1, custId); ResultSet rs = stmt.executeQuery();

} conn.close(); } catch (SQLException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } //Code to display the details }


Advertisement
View Answers

March 12, 2011 at 4:14 PM


<%@page import="java.sql.*"%>
<table border=1>
<tr><th>Name</th><th>Age</th><th>Address</th><th>Phone No</th><th>Date</th></tr>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:student","","");
String sql = "select * from data where id= ?";
PreparedStatement stmt = con.prepareStatement(sql);
stmt.setInt(1, 1);
ResultSet rs = stmt.executeQuery();
if(rs.next()){
%>
<tr><td><%=rs.getString("name")%></td><td><%=rs.getInt("Age")%></td><td><%=rs.getString("address")%></td><td><%=rs.getInt("phoneNo")%></td><td><%=rs.getDate("date")%></td></tr>
<%
}
rs.close();
stmt.close();
con.close();
}
catch(Exception e){
System.out.println(e);
}
%>
</table>


Related Tutorials/Questions & Answers:
Displaying date in the preciding code
Displaying date in the preciding code  while deploying the Bill date...[] status = new String[3]; try { //Code to connect to the database String sql...) { e.printStackTrace(); } //Code to display the details
Displaying Date in jsp - JDBC
Displaying Date in jsp  I want to insert Date of birth of a person... to interact with database.My JSP code for inserting Date is below: String dateStr... SimpleDateFormat("dd-MM-yyyy "); Date result = formater.parse(dateStr
Advertisements
Displaying files on selection of date.
Displaying files on selection of date.  Hi, I am developing a GUI, where i select from and to date. On selection of from and to date the GUI should show the particular txt files of the selected date. I want the java logic
Displaying html code in pdf with itext - Java Beginners
Displaying html code in pdf with itext   Hi , I am geeting data which was enterd from fck editor. same data is stored in the database i need to display this data in the pdf . i am using itext to create
Displaying Date in Servlet
Displaying Date in Servlet     ... a current date and time on our browser. It is very easy to display it on our browser by using the Date class of the java.util package.  As we know that the our
this is my code java - Date Calendar
this is my code java  /* * NewJFrame.java * * Created on 11... NOT modify this code. The content of this method is * always regenerated...); jLabel1.setText("Date now"); jLabel2.setText("Result Date
Date and Time Format Example
Date and Time Format Example       This Example shows you date and time format according to the locale. In the code given below we are displaying data and time
Javascript get Date And Selected Option Text
. This example explains how to write the Javascript code for displaying...Javascript get Date And Selected Option Text In this tutorial we will learn about how to get Date from the textbox and displayed as Date as well as how
Jsp Code to store date in database - JSP-Servlet
Jsp Code to store date in database   Hi, Can u give me jsp code to store current date in to database. Thanks Prakash
jsp code for date generation - JSP-Servlet
jsp code for date generation  hai i am meyis i need a jsp program code for date generation.(mssql-back end) Fields are fromdate and todate both... the server.fromdate is current system date. how to generate the date between
Date Time Problem In Jsp code - Development process
Date Time Problem In Jsp code  Hi Friends, By using this code , am storing date and time into msaccess database. But while retriving i want to get same date and time .send me code for that. SimpleDateFormat
NSLog Date example code
In this following code we have create a variable to of NSDate class and then used the NSLog function to print the date on the console. // // ...{     today= [NSDate date];     NSLog(@"
PHP Displaying the date and time in your timezone Tutorial
PHP Date Time Zone       In PHP Date Time Zone class displays the time of different time zone, along with time it is also capable of displaying the longitude, latitude and comment
How to write the code for date in swings - Struts
How to write the code for date in swings  Hi Friends, I want to code for display the calendar.......technologies use only swing and core java also how to display calendar like that popup window.....please write and send me
Code to insert date in to database - Development process
Code to insert date in to database  Hi , in my following code i want to store date in to msaccess database. i have tried many queries, but am getting error . plz send me code Error 500--Internal Server Error
php code: how to insert manual date and also retrieve records by selecting date field. - Date Calendar
php code: how to insert manual date and also retrieve records by selecting date field.  In PHP, how to insert user input date on mysql db. and also... to get the records by selecting date field in mysql. Please give me a correct code
Two Dates code validation - Date Calendar
Two Dates code validation  Hi Sir.I am using calender for two text fields which is Date of birth and date of joining.i want validate date of join should be greater than date of birth.plz help me in code .  Hi Friend
codes for displaying in calendar
codes for displaying in calendar  can i get jsp codes for displaying comments, when the pointer is placed over the particular date in calendar
displaying data
displaying data   how to display data from database on jsp using struts2
Struts: validations code to support 2 date foramats - Struts
Struts: validations code to support 2 date foramats  What is the code in validation.xml to support 2 date formats (DD-MM-YYYY & DD/MM/YYYY ) in form. (I'm using struts 1.3
Image is not displaying
Image is not displaying  Hii i am using spring javamail with html template to send mail,i am facing that image displaying prob when mail have to cm in gmail,in template just i am giving my current location of image which
javascript cal code for selecting date in text field - JSP-Servlet
javascript cal code for selecting date in text field  HI I want javascript calendar code to select date in text field in jsp.pls send me?  Hi Friend, Please visit the following links: http://www.roseindia.net
displaying image
displaying image  how to upload image and retrieve it form database mysql in php?   Here is an example of uploading image using php. 1)form.html: <form method="post" enctype="multipart/form-data" action="upload.php
displaying - Ajax
explain in detail and send me source code. Please visit for more information
date
date   how to insert date in database? i need coding
Java Script Code of Calendar and Date Picker or Popup Calendar
Java Script Code of Calendar and Date Picker or Popup Calendar...; This is detailed java script code that can use for Calendar or date picker or popup... selected date from the date picker.  2: calendar.js: Java script code file
date
date  i want difference between the date entered in a jtextfield and the system date in java
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
PHP Displaying URL Content
PHP Displaying URL Content  In my PHP application form, on submitting the form details it always displaying url content. Can anyone tell me what is the reason and how to restrict it from displaying
displaying in ajax - Ajax
displaying in ajax  hi.. I have an Ajax page ,request gone to server... the current date and time from server and shows on the form. To view the current date and time click on the following button
DATE
DATE  I have the following as my known parameter Effective Date... of calcultion starts My question is how to find the date of Thursday This cycle... the date of all the thursdays of the given year. import java.util.*; import
image displaying in java
image displaying in java  how to display an image by using load image button in applet viewer
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
(Displaying a calendar in GUI
(Displaying a calendar in GUI  (Displaying a calendar) Write a program that displays the calendar for the current month, as Use labels, and set texts on the labels to display the calendar."The Calendar and GregorianCalendar
autocomplete displaying multiple fields
autocomplete displaying multiple fields  How can I create an autocomplete with three field (name, id, phone). Placing the phone field in the appropriate input field but selecting the name field into the 'calling' input box
xml displaying a drives data.....
xml displaying a drives data.....  Hi all, I need a solution for displaying content of a drive(Ex: c , d , e ) in the browser using the XML... a solution for displaying content of a drive(Ex: c , d , e ) in the browser using
Display Date and Time - Design concepts & design patterns
Display Date and Time  HI, Can u send me Html code displaying system date and time . Thanks Prakash  Hi Friend, Try the following code: System Date and Time var date = new Date(); document.write
Displaying Rows - JSP-Servlet
Displaying Rows  Hi, I need your support on how to display data from... servlet or jsp  Hi friend, This is form code, display data... information, http://www.roseindia.net/servlets/   Display code
Displaying error on the Same form
Displaying error on the Same form  I want to display the errors on the same form(Top of the form) after validation. I am used Div element and Table to display the error messages. It is working properly. But those error messages
Displaying file from database
Displaying file from database  I have list of files in my database. I want to display these files in browser according to the input. My need is like google search result. when i click on the link it should display
Displaying java.util.Calendar using JSP struts tags
Displaying java.util.Calendar using JSP struts tags  My question is in regard to displaying a date whose source is java.util.Calendar... and display it as <s:date name="todayDate" format="yyyy-MM-dd" />
displaying a physical webpage with frames in iframe
displaying a physical webpage with frames in iframe  i have iframe...,page with frames spoils the party. my code for getting the html file <...="sss"><%=s%></a> <% } %> mycode for displaying
Displaying image using jsp and spring.
Displaying image using jsp and spring.  how to display an image stored in WEB-INF/images folder on the browser using jsp and spring
 

 

 

DMCA.com