
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 }

<%@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>
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.