Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I tried the code below. I'm using both image and text for update, but I'm getting an application error. Can't infer the SQL type to use for an instance of this error I'm getting.

QuestionRef questionRef = ceBean.get("questionRef");
QuestionRef oldQuestionRef = this.getQuestionRef(ceBean);
questionRef.setAnswerId(oldQuestionRef.getAnswerId());
int i = 0;
MultipartFile[] answerImage = questionRef.getAnswerImage();
for (String answer : questionRef.getAnswerId()) {
    QuestionAns questionAns = new QuestionAns();
    if (answerImage[i].getSize() > 0) {         
        questionAns.setImage_answer(XUtil.encodeToBase64(answerImage[i].getBytes()));
        ceBean.put("questionAns", questionAns);
        questionRefDAO.updateAnswerImage(ceBean);
    }
    else if (StringUtils.isNotBlank(questionRef.getAnswer()[i])) {
        ceBean.put("questionAns", questionAns);
        questionRefDAO.updateAnswer(ceBean);
    }
    i++;
}
Long q_id = questionRef.getQuestion_id();
questionRef.setQuestion_id(q_id);       
ceBean.put("questionRef", questionRef);
questionRefDAO.updateQuestionRef(ceBean);
share|improve this question
3  
Please don't shout :( –  BackSlash Nov 8 '13 at 10:30
    
when did i shouted?.. @BackSlash –  user51188 Nov 8 '13 at 10:34
3  
When you use the CAPS LOCK IT SEEMS YOU ARE SHOUTING US –  BackSlash Nov 8 '13 at 10:34
1  
StackTrace....? –  Dangling Piyush Nov 8 '13 at 10:37
    
oh i don't know that sorry..@BackSlash –  user51188 Nov 8 '13 at 10:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.