Hello Ranchers.. I'm using JSP and Oracle for doing a project the table details for the particular table is like this
sailing_date date nulls
so in the resultset when i try to get the values in dd/mmm/yyyy format it is showing no values..
the code i've done like this ------------------------------------------------------------------------- Calendar timeNow = Calendar.getInstance(); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MMM/yyyy"); Resultset rs = stmt.executeQuery(query); String sail_date=""; while(rs.next()) { if(rs.getDate(1)==null) sail_date=""; else dateFormat.format(rs.getDate(1)); } out.println(sail_date);
-------------------------------------------------------------------------- if there is no date value in the table then it is displaying fine.. if there is date values .. it is showing error.. the error is java.sql.SQLException: No data found
But there is a date value in the table.. if i remove all the formating and put just while(rs.next()) { sail_date = rs.getDate(1); } out.println(sail_date); it is showing the date from the table..
What may be the problem.. ranchers Please help me..