Search This Blog

Thursday, September 29, 2011

OAF - String to SQL Date

Convert the String object to java.sql.Date object using stringToDate() function from oracle.apps.fnd.framework.OANLSServices class like below.

java.sql.Date getClientSysdate(){
OADBTransaction trx =
OANLSServices nls = trx.getOANLSServices();
oracle.jbo.domain.Date serverDate = trx.getCurrentDBDate();

java.util.Date javaClientDate = nls.getUserDate(serverDate);
long longDate = javaClientDate.getTime();
return new java.sql.Date(longDate);

No comments:

Post a Comment