wood burning stoves 2.0
The moose likes JDBC and Relational Databases and the fly likes choosing current date from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "choosing current date from database" Watch "choosing current date from database" New topic

choosing current date from database

amit malhotra
Ranch Hand

Joined: Aug 06, 2001
Posts: 30
Hello Friends,
i am developing an application where we have a front end form with button Birthdays Today written on it .When any user clicks the button he is able to view the people in our department having their birthday on current day,I have a backend database in oracle with birth dates stored in it,how can i write a code for the same,the birthdates are in the format yyyy.mm.dd(ex:1975.10.13).please could some one tell me.

Joined: Aug 01, 2000
Posts: 7
Yeah you can do this by formatting the date like this.
select * from your_table_name
where birth_date = to_char(sysdate,'yyyy.mm.dd');
Hope this works fine for your query.
Thanks & Regards,
Thanks & Regards,

Thanks & Regards,<br />Murthy
Surya Bahadur
Ranch Hand

Joined: Sep 28, 2000
Posts: 88
Try using SimpleDateFormat in the Java class so that your query works even when you switch the database from Oracle to Say DB2.If you are sure that you are going to use only oracle the previous answer by asnmurthy would be fine.
amit malhotra
Ranch Hand

Joined: Aug 06, 2001
Posts: 30
thanx a lot for the reply i hope it works.....
I agree. Here's the link: http://aspose.com/file-tools
subject: choosing current date from database
jQuery in Action, 3rd edition