retrieve oracle database Date column in java using Calendar Instance and compare with today's date -


i have oracle database date column in , want retrieve recordset using calendar since want compare today's date built using calendar.

not sure meant retrieving date "using calendar", if using java, , want read date database , compare today's date, goes this:

java.sql.date dbdate = resultset.getdate("datefield"); java.util.date date = new date(dbdate.gettime()); calendar calendar = calendar.getinstance(); java.util.date today = calendar.gettime(); // "today = new date();" work if (date.before(today)) {     // } else if (date.after(today)) {     // else } 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -