How to show data from oracle 10g table in a jqGrid using spring and hibernate? There are some data present in the table and I want to show them in a editable jqGrid table in jsp. can anyone guide me how to do it.
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception {
rel_details reldetails = (rel_details) command;
List l=reldetailsdao.save_release_details(reldetails);
JSONObject responseDetailsJson = new JSONObject();
JSONArray jsonArray = new JSONArray();
Iterator itr=l.iterator();
rel_details asd=null;
while(itr.hasNext()){
asd=(rel_details)itr.next();
JSONObject formDetailsJson = new JSONObject();
formDetailsJson.put("rel_id", asd.getRel_id());
formDetailsJson.put("rel_name", asd.getRel_name());
formDetailsJson.put("rel_modified_date", asd.getRel_modified_date());
formDetailsJson.put("rel_desc", asd.getRel_desc());
formDetailsJson.put("rel_env", asd.getRel_env());
formDetailsJson.put("rel_change_req_no", asd.getRel_change_req_no());
formDetailsJson.put("rel_status", asd.getRel_status());
jsonArray.add(formDetailsJson);
}
responseDetailsJson.put("l", jsonArray);
System.out.println(responseDetailsJson);
return new ModelAndView("add_release","rel",responseDetailsJson);
You have to go through the below steps to show your result in jqgrid if your technology stack is Java and Spring.
Then create a JSP which will refer the above url as below to show and edit the results.
You have to have Jackson jar (e.g., jackson-all-x.x.x.jar) in classpath to do the necessary JSON conversion. Accordingly you have to use @RequestBody and @ResponseBody annotations.
Hope this helps you move forward. In case you have any issue, you can refer the link here.