Rob Spoor wrote:java.sql.Date does not override the equals method. That means that it uses the implementation of java.util.Date. That will only return true if the other object is another Date with the exact same timestamp, in milliseconds. I really doubt that you have such values in the database.
To compare on days, please SearchFirst. Our Java in General forum has seen that question many times already.
Abhishekshri Shrivastava wrote:pourush,
Can you check the value you are getting from select query. Try to print the value of dt1 and check what value you are getting here.Do also check the format.
Your code should work.
even you can also compare the dates in following way:-->