Hi All,
I am trying to fetch recoreds from database based on querry(i.e, resultSet= mystat.executeQuery("select name,age from dept_Inventk
where age>=" +this.age);)
Now, I am getting the querry reasult in my jsp page.I want to bulld a xml file to store all data.The requirement is to show only
records at one point of time and again when user clicks next button the rest five records should be displayed .My idea is to use xml
and to create xml structure directly from the result set what I am reciving in JSP page.
Please help me in making xml structure and to parse it (using DOM parser) and to display it to user in tabular form.
It is quite urgent so please pay attention to it.
Best Regds. and thanx in adv.,
ashok
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
<jsp:useBean id="test" class="ashokP.selectDB" scope="application"/>
<jsp:setProperty name="test" property="age" param="setAge" />
<%@ page import="java.sql.ResultSet%>
<%@ page import="javax.xml.parsers.*,org.w3c.dom.*,org.xml.sax.*,java.io.*,"%>
<%
String name;
%>
<%
ResultSet resultSet=test.selectDB();
try{
while(resultSet.next())
{
name=resultSet.getString(1);
out.println(name);
}
}
catch(Exception ee){}
finally{}
String str2="name";
DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
DocumentBuilder db =dbf.newDocumentBuilder();
Document doc = db.newDocument ();
Element root = doc.createElement(str2);
doc.appendChild(root);
root.setNodeValue("Ashok");
root.setAttribute("A0","NM");
try{
doc=db.parse(root);
}
catch(Exception dd){}
%>
</BODY>
</HTML>
Best Regds.,
Ashok
Yahoo! Properties Special Buy, sell, rent...your flat, or even post an ad