<%@ page import="java.sql.*" %> Spagetti JSP

Spagetti JSP

Show:

<% Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", ""); PreparedStatement pstmt = con.prepareStatement("SELECT f1,f2 FROM t1"); ResultSet rs = pstmt.executeQuery(); while(rs.next()) { int f1 = rs.getInt(1); String f2 = rs.getString(2); %> <% } rs.close(); pstmt.close(); con.close(); %>
F1 F2
<%=f1%> <%=f2%> Delete

Add:

F1:
F2: