学生信息管理系统JSP版EclipseWord下载.docx
《学生信息管理系统JSP版EclipseWord下载.docx》由会员分享,可在线阅读,更多相关《学生信息管理系统JSP版EclipseWord下载.docx(10页珍藏版)》请在冰豆网上搜索。
代码:
%@pagelanguage="
java"
contentType="
text/html;
charset=UTF-8"
pageEncoding="
UTF-8"
%>
!
DOCTYPEhtmlPUBLIC"
-
2)右击项目->
Properties->
JavaBuildPath改为如图(需先在WEB-INF下新建classes)
3)将MySQL中一个jar包复制到/WEB-INF/lib下,如图:
3、在/WebContent下new一个JSPfile,名字为
代码如下:
UTF-8"
<
%@pageimport="
.*"
4、改进版本display1
1)将复制粘贴到本项目的/WebCont下并修改命名为
2)在/src下new一个新包,包名为
并在此包下新建两个新类来处理SQL的Helper。
package.*;
包和包
主要代码修改为<
内的修改,代码如下:
.*;
import"
"
%>
-"
-//W3C//DTDHTMLTransitional//EN"
"
>
html>
head>
metahttp-equiv="
Content-Type"
content="
title>
updatetheresult<
/title>
/head>
%@includefile="
%
("
);
Stringid=("
id"
Stringname=("
name"
//StringclassName=("
class"
intage=("
age"
));
Stringsql="
updatestudentinfosetname='
+name+"
'
age="
+age;
Connectionconn=("
jdbc:
"
root"
"
123456"
Statementstmt=();
intresult=(sql);
if(result>
0)
("
更新记录成功!
else("
更新记录失败!
();
/html>
12、
divalign="
center"
style="
height:
120px;
background-image:
url('
images/'
/div>
hr>
30;
background-color:
#ccc;
border:
solid;
color:
red;
ahref="
增加记录<
/a>
查询记录<
13、
TABLEalign="
id="
bottom"
cellSpacing=0cellPadding=0height="
50"
border=0width="
100%"
bgcolor="
f5f5f5"
border-top:
#068500solid0px;
TR>
TDstyle="
font-family:
宋体;
font-size:
12px;
#002200"
align="
Copyright&
copy;
2011-2012&
nbsp;
Astyle="
vertical-align:
middle;
href="
数学与信息科学学院<
/A>
&
AllRightsReserved<
/TD>
/TR>
/TABLE>
测试:
测试Hello页面:
(测试文件):