You can concatenate the Query string based on the condition whether the
parameter is null or not
public SearchQuery[] getSearchResult(String rxm_number, String
facility, String upload_date, String comments, String document_desc,
String archive, String document,String document_seq) {
String strQuery = "select * from tablename where ";
if (rxm_number !="")
{
strQuery = strQuery + " rxm_number = '" + rxm_number +"' and";
}
if (facility!="")
{
strQuery = strQuery + " facility = '" + facility + "' and";
}
//like that u can add dynamically based on the condition..
//Take care on 'and '
}