The procedure is as follows <% @ Page ContentType = "text / html; charset = GB2312"%> <% @ page import = "java.sql. *"%>
<% class.forname ("com.mysql .jdbc.Driver ".) newInstance (); String url =" jdbc: mysql:? // localhost / test user = root & password = & useUnicode = true & characterEncoding = 8859_1 "; // testDB name for your database Connection conn = DriverManager.getConnection (url); Statement stmt = conn.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); String sql = "select * from` 333` "; ResultSet rs = stmt.executeQuery (sql); while (rs.next ()) {%> Your first field content is: <% = rs.getstring (1)%> Your second field content is: <% = rs.getstring (2)%> <%}%> <% OUT.PRINT ("Database Operation, Congratulations");%> <% rs.close (); stmt.close (); conn.close ();%> body> html>