資源簡介
完整課程設(shè)計(jì)及源碼,基于蘋果手機(jī)ios圖書管理系統(tǒng)
代碼片段和文件信息
package?com.mobileserver.dao;
import?java.sql.ResultSet;
import?java.sql.Timestamp;
import?java.util.ArrayList;
import?java.util.List;
import?com.mobileserver.domain.Book;
import?com.mobileserver.util.DB;
public?class?BookDAO?{
public?List?QueryBook(String?barcodeString?bookNameint?bookTypeTimestamp?publishDate)?{
List?bookList?=?new?ArrayList();
DB?db?=?new?DB();
String?sql?=?“select?*?from?Book?where?1=1“;
if?(!barcode.equals(““))
sql?+=?“?and?barcode?like?‘%“?+?barcode?+?“%‘“;
if?(!bookName.equals(““))
sql?+=?“?and?bookName?like?‘%“?+?bookName?+?“%‘“;
if?(bookType?!=?0)
sql?+=?“?and?bookType=“?+?bookType;
if(publishDate!=null)
sql?+=?“?and?publishDate=‘“?+?publishDate?+?“‘“;
try?{
ResultSet?rs?=?db.executeQuery(sql);
while?(rs.next())?{
Book?book?=?new?Book();
book.setBarcode(rs.getString(“barcode“));
book.setBookName(rs.getString(“bookName“));
book.setBookType(rs.getInt(“bookType“));
book.setPrice(rs.getFloat(“price“));
book.setCount(rs.getInt(“count“));
book.setPublishDate(rs.getTimestamp(“publishDate“));
book.setPublish(rs.getString(“publish“));
book.setIntroduction(rs.getString(“introduction“));
book.setBookPhoto(rs.getString(“bookPhoto“));
bookList.add(book);
}
}?catch?(Exception?e)?{
e.printStackTrace();
}?finally?{
db.all_close();
}
return?bookList;
}
/*?傳入圖書對(duì)象,進(jìn)行圖書的添加業(yè)務(wù)?*/
public?String?AddBook(Book?book)?{
DB?db?=?new?DB();
String?result?=?““;
try?{
/*?構(gòu)建sql執(zhí)行插入新圖書?*/
String?sqlString?=?“insert?into?Book(barcodebookNamebookTypepricecountpublishDatepublishintroductionbookPhoto)?values?(“;
sqlString?+=?“‘“?+?book.getBarcode()?+?“‘“;
sqlString?+=?“‘“?+?book.getBookName()?+?“‘“;
sqlString?+=?book.getBookType()?+?““;
sqlString?+=?book.getPrice()?+?““;
sqlString?+=?book.getCount()?+?““;
sqlString?+=?“‘“?+?book.getPublishDate()?+?“‘“;
sqlString?+=?“‘“?+?book.getPublish()?+?“‘“;
sqlString?+=?“‘“?+?book.getIntroduction()?+?“‘“;
sqlString?+=?“‘“?+?book.getBookPhoto()?+?“‘“;
sqlString?+=?“)“;
db.executeUpdate(sqlString);
result?=?“圖書添加成功!“;
}?catch?(Exception?e)?{
e.printStackTrace();
result?=?“圖書添加失敗“;
}?finally?{
db.all_close();
}
return?result;
}
/*?刪除圖書?*/
public?String?DeleteBook(String?barcode)?{
DB?db?=?new?DB();
String?result?=?““;
try?{
String?sqlString?=?“delete?from?Book?where?barcode=‘“?+?barcode?+?“‘“;
db.executeUpdate(sqlString);
result?=?“圖書刪除成功!“;
}?catch?(Exception?e)?{
e.printStackTrace();
result?=?“圖書刪除失敗“;
}?finally?{
db.all_close();
}
return?result;
}
/*?根據(jù)圖書條形碼獲取到圖書?*/
public?Book?GetBook(String?barcode)?{
Book?book?=?null;
DB?db?=?new?DB();
String?sql?=?“select?*?from?Book?where?barcode=‘“?+?barcode?+?“‘“;
try?{
ResultSet?rs?=?db.executeQuery(sql);
if?(rs.next())?{
book
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????1052776??2013-11-20?20:24??雙魚林蘋果ios圖書管理系統(tǒng)\客戶端程序\iosclient.zip
?????文件???????8606??2013-11-13?17:20??雙魚林蘋果ios圖書管理系統(tǒng)\數(shù)據(jù)庫\iosbooksystem\admin.frm
?????文件???????8872??2013-11-13?17:20??雙魚林蘋果ios圖書管理系統(tǒng)\數(shù)據(jù)庫\iosbooksystem\book.frm
?????文件???????8648??2013-11-13?17:20??雙魚林蘋果ios圖書管理系統(tǒng)\數(shù)據(jù)庫\iosbooksystem\booktype.frm
?????文件?????????61??2013-11-13?17:04??雙魚林蘋果ios圖書管理系統(tǒng)\數(shù)據(jù)庫\iosbooksystem\db.opt
?????文件???????8712??2013-11-13?17:20??雙魚林蘋果ios圖書管理系統(tǒng)\數(shù)據(jù)庫\iosbooksystem\loaninfo.frm
?????文件???????8884??2013-11-13?17:20??雙魚林蘋果ios圖書管理系統(tǒng)\數(shù)據(jù)庫\iosbooksystem\reader.frm
?????文件???????8660??2013-11-13?17:20??雙魚林蘋果ios圖書管理系統(tǒng)\數(shù)據(jù)庫\iosbooksystem\readertype.frm
?????文件???????5158??2013-11-20?17:53??雙魚林蘋果ios圖書管理系統(tǒng)\數(shù)據(jù)庫\iosbooksystem.sql
?????文件???????3036??2013-07-26?19:40??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\.classpath
?????文件????????315??2013-11-21?01:42??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\.myme
?????文件???????1420??2013-11-13?17:05??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\.project
?????文件????????500??2013-01-20?22:05??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\.settings\.jsdtscope
?????文件????????105??2013-11-21?01:41??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\.settings\com.genuitec.eclipse.core.prefs
?????文件????????330??2013-01-20?22:05??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\.settings\org.eclipse.jdt.core.prefs
?????文件?????????49??2013-01-20?22:05??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2013-01-20?22:05??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件???????1796??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\beans.xm
?????文件???????4462??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\dao\BookDAO.java
?????文件???????3000??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\dao\BookTypeDAO.java
?????文件???????3588??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\dao\LoanInfoDAO.java
?????文件???????4853??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\dao\ReaderDAO.java
?????文件???????3146??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\dao\ReaderTypeDAO.java
?????文件???????1945??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\domain\Book.java
?????文件????????684??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\domain\BookType.java
?????文件???????1137??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\domain\LoanInfo.java
?????文件???????2067??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\domain\Reader.java
?????文件????????732??2013-11-13?16:59??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\domain\ReaderType.java
?????文件???????7946??2013-11-20?01:37??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\servlet\BookServlet.java
?????文件???????4860??2013-11-17?21:30??雙魚林蘋果ios圖書管理系統(tǒng)\服務(wù)器端程序\src\com\mobileserver\servlet\BookTypeServlet.java
............此處省略328個(gè)文件信息
評(píng)論
共有 條評(píng)論