Js|mysql for the message board, is to access the database, so opendata.jsp is essential.
<%
Class.forName ("Com.mysql.jdbc.Driver"). newinstance ();
String URL
= "jdbc:mysql://localhost/mydate?user=root&password=zsliuyu&useunicode=true&characterencoding= GB2312 ";
Connection con=drivermanager.getconnection (URL);
Statement smt=con.createstatement ();
ResultSet rs;
String SQL;
%>
opendata.jsp;
Message board must keep the message in the database, connect the database, we will put the user's rumors into the database:
<%@ page import= "java.sql.*"%>
<%@ page import= "java.util.*"%>
<%@ include file= "opendata.jsp"%>
<%@ include file= "convert.jsp"%>
<%@ page contenttype= "text/html;charset=gb2312"%>
<%
String Name,email,subject,memo,sex;
Name=request.getparameter ("name");
Sex=request.getparameter ("Sex");
Email=request.getparameter ("email");
Subject=request.getparameter ("subject");
Memo=request.getparameter ("Memo");
if (Name.length () ==0| | Email.length () ==0| | Subject.length () ==0| | Memo.length () ==0)
{
Out.print ("<center><font color=red size=6> input field is not nullable </font>");
Out.print ("Out.print ("<a href=message.htm> I want to Message </a>");
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.