jsp怎么把网页上文本框输入的值插入到数据库中
帮忙给看一下
<%@ 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">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'addbiaoge.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="addbiaoge.css">
<script type="text/javascript">
function add(){
String a=document.getElementById('didian').value;
String b=document.getElementById('bumen').value;
String b=document.getElementById('yonghuming').value;
String d=document.getElementById('shiyongren').value;
String e=document.getElementById('ipdizhi').value;
String f=document.getElementById('macdizhi').value;
String g=document.getElementById('neicun').value;
String h=document.getElementById('beizhu').value;
}
</script>
</head>
<body>
<%
Connection con = null;
Statement stat = null;
ResultSet rs = null;
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String url = "jdbc:sqlserver://localhost:1433;databasename=meng";
String user = "sa";
String password = "1";
con = DriverManager.getConnection(url, user, password);
stat = con.createStatement();
%>
<div class="top">
</div>
<div style="width:1200px">
<form action="biaoge.jsp" method="get">
<table class="table">
<tr>
<td>地点</td>
<td>部门</td>
<td>用户名</td>
<td>使用人</td>
<td>ip地址</td>
<td>mac地址</td>
<td>内存</td>
<td>备注</td>
</tr>
<tr>
<td><input type="text" id="didian"></td>
<td><input type="text" id="bumen"></td>
<td><input type="text" id="yonghuming"></td>
<td><input type="text" id="shiyongren"></td>
<td><input type="text" id="ipdizhi"></td>
<td><input type="text" id="macdizhi"></td>
<td><input type="text" id="neicun"></td>
<td><input type="text" id="beizhu"></td>
</tr>
<input type="button" name="" onclick="add()" value="保存记录">
</table>
</form>
</div>
<%
String sql = "insert into xinxi(didian,bumen,yonghuming,shiyongren,ipdizhi,macdizhi,neicun,beizhu) vaules('"+a+"','"+b+"','"+c+"','"+d+"','"+e+"','"+f+"','"+g+"','"+h+"') ";
rs = stat.executeQuery(sql);
%>
</body>
</html>