Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting java.sql.Timestamp to database parameter for between clause.

 
dhani dhani
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a query which returns a timestamp. I want to use this in the between clause. I am using java on DB2 database.
Something like this
Col1_timestamp between col2_timestamp and col3_timestamp.
Both col2_timestamp and col3_timestamp are java.sql.Timestamp variables. I want to convert these java variables to database acceptable timestamp format.
Hope someone can help me in this...
 
Paul Clapham
Sheriff
Posts: 21576
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use a PreparedStatement, the JDBC driver will take care of that conversion for you. I highly recommend that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic