public ResultObject takePrefixGroupId(ArrayList prefixGroupName)
{
debugLog(MODULE_NAME, "Inside the takePrefixGroupId() of LCRConfigurationSessionBean");
ResultObject resultObject = new ResultObject(LCRResponseCode.LCR_CONFIGURE_SEARCH_ERROR_EJB, null);
String strSelectQuery = null;
String strMessage=null;
ResultSet resSet = null;
Collection colInValideRecord =new ArrayList();
Collection colErrorMessage=new ArrayList();
Collection colValidRecord = new ArrayList();
Collection colDataValidation=null;
try{
for(int i=0;i<prefixGroupName.size();i++)
{
strSelectQuery = "select DESTINATIONGROUPID from TBLMDESTINATIONGROUP where NAME='"+prefixGroupName.get(i)+"'";
debugLog(MODULE_NAME, "Query::::::"+strSelectQuery);
resultObject = execute(strSelectQuery);
if(resultObject.getResponseCode() == LCRResponseCode.SUCCESS_RESPONSE_CODE)
{
resSet = (ResultSet)resultObject.getResponseObject();
debugLog(MODULE_NAME, "resSet::::::"+resSet);
if(resSet != null)
{
while(resSet.next())
{
colValidRecord.add(resSet.getString("DESTINATIONGROUPID"));
}
}
else
{
strMessage=LCRResponseCode.errorCodeToMessage(LCRResponseCode.PREFIX_GROUP_DOES_NOT_EXIST_ERROR);
debugLog(MODULE_NAME,"MESSAGE::: "+strMessage);
colErrorMessage.add(strMessage);
colInValideRecord.add(prefixGroupName);
debugLog(MODULE_NAME,"No Prefix Group is found.");
}
colDataValidation=new ArrayList();
colDataValidation.add(colValidRecord);
colDataValidation.add(colInValideRecord);
colDataValidation.add(colErrorMessage);
resultObject.setResponseObject(colDataValidation);
resultObject.setResponseCode(LCRResponseCode.SUCCESS_RESPONSE_CODE);
}
else
{
debugLog(MODULE_NAME, "Unable to execute search query for in searchDestination() of LCRConfigurationSessionBean.");
resultObject.setResponseCode(LCRResponseCode.LCR_CONFIGURE_SEARCH_ERROR_EJB);
}
}
}
catch(Exception e)
{
e.printStackTrace();
errorLog(MODULE_NAME, "exception in searchDestination() of LCRConfigurationSessionBean");
resultObject.setResponseCode(LCRResponseCode.LCR_CONFIGURE_SEARCH_ERROR_EJB);
resultObject.setException(e);
}
return resultObject;
}
Dies ist der CodeWas ist der Wert von resultset, wenn die Abfrage keinen Datensatz zurückgibt?
eine Neuformatierung Ihres Codes ist ein Muss, wenn Sie Antworten wünschen. für Formatierungshilfe, gehen Sie zu http://stackoverflow.com/editing-help – Jason
@Jason: getan :) – Asaph
Vanita: Sie haben 13 Fragen gestellt und 0 Antworten angenommen. Die Leute wollen dir nicht helfen, wenn du keine Antworten akzeptierst. –