This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Passing parameter to date function in DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Passing parameter to date function in DB2" Watch "Passing parameter to date function in DB2" New topic
Author

Passing parameter to date function in DB2

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
HI all
I need to find the difference between the date the user enters and the current date. and i used the below query to find it out.



i am using the prepared statement to pass the values to this query, using the
prepStmtOj.setObject(1,"2006-01-01");

i even tried hard coding the values but still i am getting the error.

Have anyone know what the reason. The format of the date i am passing in is valid one. i seen some examples using above date format.


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Passing parameter to date function in DB2