<% @ Page ContentType = "Text / HTML; Charset = GB2312"%> <% @ page import = "java.sql. *"%>
<% class.Forname ("com.microsoft.jdbc .sqlserver.sqlserdriver "). NewInstance (); string url =" JDBC: Microsoft: SQLServer: // localhost: 1433; DatabaseName = km_news;
String user = "sa"; String password = ""; Connection conn = DriverManager.getConnection (url, user, password); Statement stmt = conn.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); String sql = "select * from KM_News "; ResultSet RS = Stmt.executeQuery (SQL); while (rs.next ()) {%> ÄúμÄμäòò» ¸ £ × ö¶îîäèýªªª £ o <% = rgetsª (1)%> Äúμäμúþþþþ × ö¶îääèýªª £ o <% = rs.getstring (2)%> <%}%> <% out.print ("ý¾/4ý¿2ù × 3¹ ¹ ¹ £ ¬¹¬¹ï2äã");%> <% r. Close (); stmt.close (); conn.close ();%> body> html>