hi
I want to carry out validation on a GregorianCalendar instance to check if it is present in my database as a corresponding Oracle Date field
In the existing framework, the validation is done by a class which takes
String argument and parses it to get a Date object (using DateFormat).
The class which calls the validation class gets the GregorianCalendar instance which is to be validated.
How can I pass a String representation of this GregorianCalendar instance to the validation class so that it can convert it back to an SQL Date object?
Sample Code:
The Validation class: -
.
.
.
.
.
public boolean checkAll(String iDate){
.
.
.
.
SimpleDateFormat sdfInput=new SimpleDateFormat("MM-dd-yyyy");
Date mDateValue = sdfInput.parse(iDate);
PreparedStatement lPreStatement.setDate(1,(java.sql.Date)mDateValue);
.
.
.
.
}
The Calling class: -
.
.
.
.
.
.
String lSomeDate; //to be populated with GregorianCalendar representation
boolean lbIsDatePresent = checkAll(lSomeDate);
.
.
.
.
Hope I havent made it too cryptic
Thanks in advance.
[ May 26, 2003: Message edited by: mangesh lele ]