hello frenz... I dont know if this question is to be asked in this group or not if not then plz forgive.. Actually i hv made and application in which I m supposed to start some device and then store the Start date and timein MySQL and then retrieve that date and time and show in GUI...
in
java side I m using java.util.Date and in MYSQL table I m using simple Date(I guess that is java.sql.Date)
Now problem is I m getting the Date from GUI and converting it into java.sql.Date and then inserting. but it is storing only 0000-00-00. I dont know whats going wrong. i tried forums but none is clear enough. plz help me out
I want to show time also. I dont want to change either so plz give any round about.
code to enter java date in mysql is:
java.util.Date startTime = obj.getOperationTime();
java.sql.Date time=new java.sql.Date(startTime.getTime());
String updatdev = "update DeviceApplication set DeviceApplicationStatus ="
+ status + ", DeviceApplicationStartTime =" + new java.sql.Date(startTime.getTime())+ " where DeviceApplicationID =" + deviceID;
//Execute the Query
int i = stmt.executeUpdate(updatdev);
plz help
thanx