Hi everyone,
i want to output the results of the select statement in the code below, to a html table as opposed to just a list of out.println statemants..Can someone tell me how to go about doing this please??
Thanks
oggiemc
import java.io.*;
import java.lang.*;
import java.sql.*;
public void JobSearch(String sector, PrintWriter out)
{
String thisSector = sector;
try
{
out.println("JOBID --- SECTOR --- LOCATION--- SALARY--- EMAIL--- DESCRIPTION--- COMPANY <br>");
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT * FROM FMC_JOBS WHERE SECTOR ='"+thisSector+ "'");
while (rs.next())
out.println( rs.getString("JOBID") + "---" + rs.getString("SECTOR") + "--- " +
rs.getString("LOCATION") + "--- " + rs.getString("SALARY") + "--- " + rs.getString("EMAIL")
+ "--- "+rs.getString("DESCRIPTION") + "---" + rs.getString("COMPANY") +"<br>");
}
catch (Exception e) {
out.println("<BR>An error has occurred during the Statement/ResultSet phase.");
}
}
}