資源描述:
《jsp簡(jiǎn)單的學(xué)籍管理系統(tǒng)方案.doc》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、......完成一個(gè)簡(jiǎn)單的學(xué)籍管理系統(tǒng),具體的要求如下:1、完成數(shù)據(jù)庫(kù)及其表的創(chuàng)建2、創(chuàng)建對(duì)應(yīng)的JavaBean3、對(duì)數(shù)據(jù)庫(kù)的連接單獨(dú)創(chuàng)建一個(gè)類4、在JSP頁(yè)面完成對(duì)應(yīng)的查詢、添加、刪除、修改功能。學(xué)習(xí)好幫手......Student.javapackagecn.bean;publicclassStudent{privateStringstuId;privateStringstuName;privateStringstuSex;privateintstuAge;privateStringstuJig;private
2、StringstuDept;publicStringgetStuId(){returnstuId;}publicvoidsetStuId(StringstuId){this.stuId=stuId;}publicStringgetStuName(){returnstuName;}publicvoidsetStuName(StringstuName){this.stuName=stuName;}publicStringgetStuSex(){returnstuSex;}publicvoidsetStuSex(Stri
3、ngstuSex){this.stuSex=stuSex;}publicintgetStuAge(){returnstuAge;}publicvoidsetStuAge(intstuAge){this.stuAge=stuAge;}publicStringgetStuJig(){returnstuJig;}publicvoidsetStuJig(StringstuJig){this.stuJig=stuJig;學(xué)習(xí)好幫手......}publicStringgetStuDept(){returnstuDept;}p
4、ublicvoidsetStuDept(StringstuDept){this.stuDept=stuDept;}}DBUtil.javapackagecn.database;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.SQLException;publicclassDBUtil{publicConnectiongetConnection(){Stringdriver="com.microsoft.sqlserver.j
5、dbc.SQLServerDriver";Stringurl="jdbc:sqlserver://localhost:1433;Databasename=students";Stringuser="webuser";Stringpassword="webpass";try{Class.forName(driver);}catch(ClassNotFoundExceptione){e.printStackTrace();}try{returnDriverManager.getConnection(url,user,p
6、assword);}catch(SQLExceptione){e.printStackTrace();}returnnull;}publicstaticvoidmain(String[]args){DBUtildb=newDBUtil();System.out.println(db.getConnection());學(xué)習(xí)好幫手......}}List.jsp<%@pagelanguage="java"import="java.util.*"pageEncoding="GB18030"%><%@pageimport=
7、"java.sql.*"%><%@pageimport="cn.database.*"%>
學(xué)籍管理系統(tǒng)#title{text-align:center;color:#000;font-size:30px;}td{text-align:center;}8、#ffffff"><%!Stringurl,sql;%><%!Connectionconn;//定義數(shù)據(jù)庫(kù)連接對(duì)象%><%!ResultSetrs;//定義結(jié)果集對(duì)象%><%!Statementstmt;//定義SQL語(yǔ)句對(duì)象%><%!inti;%>學(xué)籍管理系統(tǒng)