POLITECHNIKA RZESZOWSKA - Wydział Elektrotechniki i Informatyki
u
private void runQuery(PrintWriter out) throws SQLException { statement = connection.createStatement(); query = "SELECT * EROM myDatabaseTable ORDER BY id”; rs = statement.executeQuery(query); out.println("<table border ■= ;
out.println(”<trxtd>ID</td>" + "<td>Imię</td>"
+ ”<td>Nazwisko</td>" + "<td>e-inail</tdx/tr>") ; while (rs.next()) {
int id = rs.getlnt("id");
String strl = rs.getString("first^jiame");
String str2 = rs.getString("last_name");
String str3 = rs.getString("mail”); out.println(”<tr><td>" + id + "</td>" + "<td>" + strl + ”</td>" + "<td>" + str2 + "</td>" + "<td>" + str3 + "</tdx/tr>”) ;
}
out.println("</table>");
JAVA Wykład 15
n-right ® 2012 Jan PROKOP