I just contacted JSP and tried to connect to the database, but I will go to an error. Please advise.
<% @ Page ContentType = "Text / HTML; Charset = GB2312"%> <% @ page import = "java.sql. *"%>
<% class.Forname ("com.microsoft.jdbc .sqlserver.sqlserdriver "); string url =" JDBC: Microsoft: SQLServer: // localhost: 1433; databasename = iWork2; user = sa; password = sa "; // Class is my database name, you can make a corresponding modification Connection conn = drivermanager.getConnection (URL); statement stmt = conn.createstatement (); string sql = "select * from bo_fw"; ResultSet RS = stmt.executeQuery (sql); while (rs.next ()) {%> Your first field content is: <% = rs.getstring (WH)%> Your second field content is: <% = rs.getstring (rq)%> <%}%> <% out.print ("Database Operation, Congratulations");%> <% rs.close (); stmt.close (); Conn.Close ();%> body> html>