Wrox Home  
Search P2P Archive for: Go

  Return to Index  

servlets thread: Date problems


Message #1 by "Shashank Arora" <niceguyleo@i...> on Fri, 6 Sep 2002 10:12:55
Hi :)

i am using DateFomat class to format the date i retrive from the SQL 
database to store it in a String type variable which i can access later. 
the Problem i am facing is that the code containing the DateFormat does 
not give any result, i mean there is no error displayed but the results 
are not shown, even the messages that i am printing on the console after 
the code are not displayed which suggests that the code has some problems.
I am hereby sending the code. if somebody can help me out i'll be really 
greatful.

CODE STARTS HERE ..............

System.out.println("before code");
			
DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT);
rs=stmt.executeQuery("select 
attended_date,status,remarks,assigned_date,engineer_code from 
COMPLAINTSTATUS where complaint_no="+cNo);

System.out.println("rs executed");

while(rs.next()){
attended_date = fmt.format(rs.getString("attended_date"));
assigned_date = fmt.format(rs.getString("assigned_date"));
}
		
rs.close();
			
System.out.println("after code");


CODE ENDS HERE.........................


so here the messages "before code" and "rs executed" are displayed but the 
message "after code" is not displayed and so are the messages after that.

do let me know what exactly is causing the problem and how can i rectify 
it.

Thanks,
Shashank

  Return to Index