I am making a web application where I can read large data from database using hibernate in my Java Servlet. When I read large data from database field, I put it into the String with success, after that I want to put it in JSON and pass it to Javascript Ajax but it seems that data is too large for JSON. When I try to pass smaller JSON to Ajax it works fine. What's wrong at here?
This is my Ajax:
$.post("servletispistabeleuseru", {"user":user}, function(data){
    var tab=data.result;
    console.log(tab);
});
and this is my Servlet:
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("application/json");
        String user=request.getParameter("user");
        Configuration myConf = new Configuration();
        myConf.configure("hib/hibernate.cfg.xml");
        StandardServiceRegistry service = new StandardServiceRegistryBuilder().
        applySettings(myConf.getProperties()).build();
        SessionFactory myFactory = myConf.buildSessionFactory(service);
        Session conn = myFactory.openSession();
        Transaction t = conn.beginTransaction();
        List<User>useri;
        useri=conn.createQuery("SELECT u FROM User u WHERE useUsername='"+user+"'").list();
        String result=useri.get(0).getUseKineski();
        System.out.println(result);
        t.commit();
        conn.close();
        try (PrintWriter out = response.getWriter()) {
            /* TODO output your page here. You may use following sample code. */
            out.print("{\"result\":\"" + result + "\"}");
        }
    }
 
    