<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%
String str;
str=request.getParameter("text");
out.println(str);
%>
<%
String strId = request.getParameter("text");
int id = Integer.parseInt(strId);
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost/bbs?user=root&password=";
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from article where id="+strId);
while(rs.next()) {
String username = rs.getString("id");
String password= rs.getString("text");
out.println(password);
}
%>
//http://localhost/post.jsp?text=1