Here you can find the source of getHtmlRows(ResultSet results)
public static synchronized String getHtmlRows(ResultSet results) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.*; import java.sql.*; public class Main { public static synchronized String getHtmlRows(ResultSet results) throws SQLException { StringBuffer htmlRows = new StringBuffer(); ResultSetMetaData metaData = results.getMetaData(); int columnCount = metaData.getColumnCount(); htmlRows.append("<tr>"); for (int i = 1; i <= columnCount; i++) htmlRows.append("<td><b>" + metaData.getColumnName(i) + "</td>"); htmlRows.append("</tr>"); while (results.next()) { htmlRows.append("<tr>"); for (int i = 1; i <= columnCount; i++) htmlRows.append("<td>" + results.getString(i) + "</td>"); }//from w ww .j a v a 2 s . c o m htmlRows.append("</tr>"); return htmlRows.toString(); } }