Hi, I'm not sure whether the following code fit your requirement.
ResultSet results = stmt.executeQuery("SELECT * FROM emp");
// GET metadata info
ResultSetMetaData rsmd = results.getMetaData();
int numCols = rsmd.getColumnCount();
int i;
out.println("");
// column header info
out.println("");
out.println("");
for (i=1; i <= numCols; i++){
out.println("" + rsmd.getColumnLabel(i) + "");
}
out.println("");
out.println("");
// content
while (results.next()){
out.println("");
for (i=1; i <= numCols; i++) {
out.println("" + results.getString(i) + "");
}
out.println("");
}
out.println("");
-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Raja Nagendra Kumar
Sent: Wednesday, October 04, 2000 2:26 AM
To: [EMAIL PROTECTED]
Subject: How do I show JDBC ResultSet contects as a HTML Table
I posting this again as I had no replies.. Please help...
Hi!
Could anyone tell me how do I map the ResultSet Object to the HTML Table.
Currently I am trying to take each element of ResultSet and writing to a
cell on
html table... Is there any utils or tools which directly take ResultSet and
format it as HTML Table..
Does the freemarker Template API support ResultSet as the DataModel.. Even
after browing these doc's I could not figur it out..
Could any point me to some better way of doing this..
Regards,
Nagendra
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
__
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets