<%@ page language= "java" import= "java.util.*,java.sql.*" pageencoding= "Utf-8"%>
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<base href= "<%=basePath%>" >
<title>my JSP ' subway.jsp ' starting page</title>
<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This is my page" >
<!--
<link rel= "stylesheet" type= "Text/css" href= "Styles.css" >
-
<body>
<%
String dbip= "192.168.1.20:3306";
String dbname= "diancai360_haiwai20150330";
String dbuser= "root";
String dbpwd= "root12";
String dbsql= "jdbc:mysql://" +dbip+ "/" +dbname+ "? user=" +dbuser+ "&password=" +dbpwd+ "&useUnicode=true& Characterencoding=utf-8 ";
Class.forName ("Com.mysql.jdbc.Driver"). newinstance ();
Connection conn= drivermanager.getconnection (dbsql);
Request.setcharacterencoding ("Utf-8");
Response.setcharacterencoding ("Utf-8");
String f_zhou=request.getparameter ("F_zhou");
String f_shi=request.getparameter ("F_shi");
String sql= "INSERT into dc_subwaystation (f_cityid,f_subwayrouteid,f_subwaystation) VALUES (" +f_zhou+ ", '" +f_shi+ "')" ;
PreparedStatement pstmt=conn.preparestatement (SQL);
int i=pstmt.executeupdate ();
%>
Success
</body>
Receive the ET Collector data page