Skip to content

Instantly share code, notes, and snippets.

@sapanparikh18
Last active June 13, 2018 14:10
Show Gist options
  • Save sapanparikh18/f142304b2c7664c530e98757bac80c78 to your computer and use it in GitHub Desktop.
Save sapanparikh18/f142304b2c7664c530e98757bac80c78 to your computer and use it in GitHub Desktop.
public Reviewanswer getAnswer(int questionId) {
String sql = "select * from answers where questionid=:questionId";
Map<String, Object> params = new HashMap<>();
Reviewanswer answer = new Reviewanswer();
params.put("questionId",questionId);
try {
answer = namedParameterJdbcTemplate.queryForObject(sql,params,Reviewanswer.class);
}catch (DataAccessException ex){
Logger.getLogger(this.getClass().getName()).log(Level.ALL,ex.getLocalizedMessage());
}
return answer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment