This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Saswat, If you have a date/calendar object, you can call get(Calendar.MONTH) and get(Calendar.YEAR) to get these fields. If your value is stored in a date/time field in db2, you can use resultSet.getDate() to get a Date object right away.
If it really is stored as a char/varchar in the format "YYYY/MM/DD", you will need to call SimpleDateFormat to create a date first.