I created a java servlet in which I am using a JSON object and now I want to fetch the values from jSON object into my HTML page using Jquery but i don't know how to do it.
servlet code:
ResultSet rs = st.executeQuery("Select * from SampleTable");
JSONObject obj= new JSONObject();
if(rs.next())
{
String fname=rs.getString(1);
obj.put("status", "yes");
obj.put("fname",fname);
System.out.println(obj);
out.print("Hello" + obj);
}
else
{
obj.put("status", "no");
out.print(obj);
}