資源簡(jiǎn)介
Java+SQLServer實(shí)現(xiàn)的圖書(shū)管理系統(tǒng)項(xiàng)目,
代碼片段和文件信息
package?com.book.action;
import?java.io.File;
import?java.io.PrintWriter;
import?java.util.List;
import?java.util.Map;
import?javax.servlet.http.HttpServletResponse;
import?jxl.Workbook;
import?jxl.write.Label;
import?jxl.write.WritableSheet;
import?jxl.write.WritableWorkbook;
import?org.apache.struts2.ServletActionContext;
import?com.alibaba.fastjson.JSON;
import?com.book.bean.BookBiz;
import?com.book.service.BookInfoSer;
import?com.book.service.impl.BookInFoSerImpl;
import?com.opensymphony.xwork2.ActionContext;
import?com.opensymphony.xwork2.ActionSupport;
@SuppressWarnings(“serial“)
public?class?BookAction?extends?ActionSupport?{
BookInfoSer?bookinfoser?=?new?BookInFoSerImpl();
private?BookBiz?book;
private?int?page;
private?int?rows;
private?int?page2?=?1;
private?int?rows2?=?4;
private?String?search;
private?String?strIds;
private?String?dept;
public?String?bfind()?throws?Exception?{
return?“bfind“;
}
public?String?blist()?throws?Exception?{
List?infolist?=?bookinfoser.getbooklist(page2?rows2);
int?count?=?bookinfoser.getcount();
ActionContext.getContext().put(“Page2“?page2);
ActionContext.getContext().put(“Count“?count);
int?pagecount?=?(count?%?rows2)?==?0???(count?/?rows2)
:?(count?/?rows2?+?1);
ActionContext.getContext().put(“Pagecount“?pagecount);
ActionContext.getContext().put(“infolist“?infolist);
return?“blist“;
}
public?String?badd()?throws?Exception?{
return?“badd“;
}
public?void?exportExcel()?throws?Exception?{
WritableWorkbook?book?=?null;
try?{
//?準(zhǔn)備設(shè)置excel工作表的標(biāo)題
String[]?title?=?{?“圖書(shū)編號(hào)“?“圖書(shū)名稱(chēng)“?“簡(jiǎn)介“?“出版社“?“作者“?“圖片“?“圖書(shū)類(lèi)型“
“庫(kù)存“?“閱讀量“?};
//?打開(kāi)文件
book?=?Workbook.createWorkbook(new?File(“D:/測(cè)試.xls“));
//?生成名為“學(xué)生“的工作表,參數(shù)0表示這是第一頁(yè)
WritableSheet?sheet?=?book.createSheet(“圖書(shū)信息表“?0);
Label?label;
for?(int?i?=?0;?i?tle.length;?i++)?{
//?Label(xyz)?代表單元格的第x+1列,第y+1行?內(nèi)容z
//?在Label對(duì)象的子對(duì)象中指明單元格的位置和內(nèi)容
label?=?new?Label(i?0?title[i]);
//?將定義好的單元格添加到工作表中
sheet.addCell(label);
}
List?books?=?bookinfoser.getall();
int?l=0;
for?(int?i?=?1;?i?<=title.length;?i++)?{
Label label1?=?new?Label(0?i?books.get(l).getBid()+““);
Label label2?=?new?Label(1?i?books.get(l).getBname());
Label label3?=?new?Label(2?i?books.get(l).getBintro());
Label label4?=?new?Label(3?i?books.get(l).getBaddress());
Label label5?=?new?Label(4?i?books.get(l).getBauthor());
Label label6?=?new?Label(5?i?books.get(l).getBimg()+““);
Label label7?=?new?Label(6?i?books.get(l).getLname());
Label label8?=?new?Label(7?i?books.get(l).getBcount()+““);
Label label9?=?new?Label(8?i?books.get(l).getBnumber()+““);
//?將定義好的單元格添加到工作表中
sheet.addCell(label1);
sheet.addCell(label2);
sheet.addCell(label3);
sheet.addCell(label4);
sheet.addCell(label5);
sheet.addCell(label6);
she
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件???????1178??2016-05-22?07:16??Code圖書(shū)管理系統(tǒng)\BookManager\.classpath
?????文件????????306??2016-04-21?00:31??Code圖書(shū)管理系統(tǒng)\BookManager\.myme
?????文件???????1754??2016-04-17?11:24??Code圖書(shū)管理系統(tǒng)\BookManager\.project
?????文件????????500??2016-04-17?11:12??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\.jsdtscope
?????文件????????119??2016-06-07?09:30??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\com.genuitec.eclipse.core.prefs
?????文件????????242??2016-05-22?07:16??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\com.genuitec.eclipse.migration.prefs
?????文件?????????57??2016-04-17?11:14??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\org.eclipse.core.resources.prefs
?????文件????????364??2016-04-17?11:12??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\org.eclipse.jdt.core.prefs
?????文件????????550??2016-05-22?07:16??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\org.eclipse.wst.common.component
?????文件????????350??2016-05-22?07:16??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2016-04-17?11:12??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2016-04-17?11:12??Code圖書(shū)管理系統(tǒng)\BookManager\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件???????6544??2016-05-31?14:54??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\action\BookAction.java
?????文件???????1296??2016-04-20?07:57??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\action\HomeAction.java
?????文件????????345??2016-04-20?06:53??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\action\LendStillAction.java
?????文件?????????61??2016-04-18?03:18??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\action\LoginAction.java
?????文件?????????60??2016-04-18?03:21??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\action\UserAction.java
?????文件???????1775??2016-05-15?07:16??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\bean\BookBiz.java
?????文件????????930??2016-04-20?07:54??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\bean\Menu.java
?????文件????????844??2016-05-15?06:47??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\dao\BookInfoDao.java
?????文件????????178??2016-04-20?01:27??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\dao\HomeDao.java
?????文件???????9656??2016-05-15?06:48??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\dao\impl\BookInfoDaoImpl.java
?????文件???????1255??2016-04-20?07:58??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\dao\impl\HomeDaoImpl.java
?????文件????????849??2016-05-15?06:47??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\service\BookInfoSer.java
?????文件????????186??2016-04-20?01:15??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\service\HomeService.java
?????文件???????1947??2016-05-15?06:47??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\service\impl\BookInFoSerImpl.java
?????文件????????558??2016-04-20?01:27??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\service\impl\HomeServiceImpl.java
?????文件???????3043??2016-04-21?00:45??Code圖書(shū)管理系統(tǒng)\BookManager\src\com\book\util\DBUtil.java
?????文件?????????25??2016-05-22?07:16??Code圖書(shū)管理系統(tǒng)\BookManager\src\me
?????文件???????1854??2016-05-12?03:01??Code圖書(shū)管理系統(tǒng)\BookManager\src\struts.xm
............此處省略829個(gè)文件信息
評(píng)論
共有 條評(píng)論