<%@ page session="false" %> <%@ page import="java.sql.*" %> <% try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); System.out.println("JDBC driver loaded"); } catch (ClassNotFoundException e) { System.out.println(e.toString()); } %> Display All Users

Displaying All Users



<% String sql = "SELECT FirstName, LastName, UserName, Password" + " FROM Users"; try { Connection con = DriverManager.getConnection("jdbc:odbc:JavaWeb"); Statement s = con.createStatement(); ResultSet rs = s.executeQuery(sql); while (rs.next()) { out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); } rs.close(); s.close(); con.close(); } catch (SQLException e) { } catch (Exception e) { } %>
First Name Last Name User Name Password
" + rs.getString(1) + "" + rs.getString(2) + "" + rs.getString(3) + "" + rs.getString(4) + "