1. A method get yesterday's date which will return me a Java.Util.Date object.
2. get a timestamp value from DB2 table.
3. get the date value only from the timestamp.
4. Then, use the Java.Util.Date object to compare the Timestamp's date value I get from DB2 table.
my question is I don't know how to compare a Date object with a Timestamp value from DB2. What is DB2's built-in method to get date only from timestamp?
this is the error I getting:
com.ibm.db2.jcc.b.SQLException: An unexpected token "11" was found following "TMTDATE = 2006-03-15". Expected tokens may include: "OR".
You can also work with Calendar.
[Edited to make it more clear]
[ March 16, 2006: Message edited by: Adeel Ansari ]
Originally posted by Reid M. Pinchback:
I think you are making your life harder than need be. Don't even try to serialize the date as a string. Just use a prepared statement and bind the date as a parameter. Date serialization into literals is often touchy to get a database to accept, and a real nightmare if you have to support more than one database vendor.
Cent percent agreement. See this.