If you want to use Java instead of sql then use :
TalendDate.addDate(TalendDate.getCurrentDate(),-30,"dd")
or
TalendDate.addDate(TalendDate.getCurrentDate(),-1,"MM") -> -1 month
it will returns a date that you MUST convert into a string, see formatDate function
then insert the string into your query