资源简介
这里是当时学校练习课程作业及答案,所有excesse答案.

代码片段和文件信息
package library;
import java.util.*;
import java.sql.*;
import java.text.*;
/**
* class Library represents the functionality of a library
*
* @author iCarnegie
* @version 1.0
*/
public class Library {
// singleton DBWrapper
private DBWrapper myConnection = null;
/**
* class Library constructor
*/
public Library() throws Exception {
myConnection = DBWrapper.Instance();
}
/**
* holdBook places a hold on book with given call number for the given
* member
*
* @param callNumber
* String call number of book to hold
* @param member
* Member member who wishes to hold the book.
* @return boolean
*/
public boolean holdBook(String callNumber Member member) throws Exception {
String sqlQuery = “select count(*) as counted from hold where callnumber=‘“
+ callNumber + “‘ and ssn=‘“ + member.getSSN() + “‘“;
boolean alreadyHeld = false;
ResultSet r = null;
// Select the count of the books. If it is 1 this book is already held.
r = myConnection.runQuery(sqlQuery);
if (r.next()) {
if (r.getInt(“counted“) == 1) {
alreadyHeld = true;
}
}
// if alreadyHeld is true then don‘t place a hold. Place a hold
// otherwise.
if (alreadyHeld) {
return true;
} else {
sqlQuery = “INSERT INTO Hold VALUES (“ + member.getSSN() + “ ‘“
+ callNumber + “‘ CURRENT_TIMESTAMP)“;
if (myConnection.runUpdate(sqlQuery) > 0)
return true;
else
return false;
}
}
/**
* checkinBook checks the book with the specified book id into the library.
*
* @param bookId
* int id of book to check in
* @return boolean
*/
public boolean checkInBook(int bookId) throws Exception {
// Build the sql query.
String sqlQuery = “UPDATE Book SET borrowerssn = null librarianssn = null duedate = null WHERE BookID = “
+ bookId;
// Run the update.
if (myConnection.runUpdate(sqlQuery) > 0)
return true;
else
return false;
}
/**
* approve a check out for book with given book id for a member with given
* member ssn
*
* @param bookId
* int id of book to check out
* @param memberSSN
* int ssn of member who wants to check book out
* @return boolean
*/
private boolean approveCheckout(int bookId int memberSSN) throws Exception {
boolean canCheckOut = true;
// check to see if that book is already checked out
boolean checkedOut = LibraryBook.isCheckedOut(bookId);
if (checkedOut) {
canCheckOut = false;
} else {
// see if another member has higher priority on this book
// We have to check the holds if the number of
// holds on this title exceeds the number of
// available copies.
String callNumber = LibraryBook.getBook(bookId).getCallNumber();
int availabl
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1121 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\exam1.sql
文件 592270 2012-05-25 16:34 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise8.rar
文件 107520 2012-03-05 13:46 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\SSD7全部QUIZ答案.doc
..A.SH. 162 2011-07-04 14:48 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\~$D7全部QUIZ答案.doc
..A.SH. 78336 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\~WRL0003.tmp
文件 33889 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\SSD7_Exam2\第一问(ER).JPG
文件 786 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\SSD7_Exam2\第一问(ER).txt
文件 1690 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\SSD7_Exam2\第三问.txt
文件 1199 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\SSD7_Exam2\第二问.txt
文件 4506 2013-12-30 13:22 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\application.txt
文件 1586 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\deadlock(Window 1).txt
文件 1118 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\deadlock(Window 2).txt
文件 2772 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\deadlock.txt
文件 4196 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\Ex9_ssd7.rar
文件 103936 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\exe9.doc
文件 1940 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\isolation(Window 1).txt
文件 1896 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\isolation(Window 2).txt
文件 3900 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\isolation.txt
文件 2028 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\rollback.txt
文件 305401 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\桌面.rar
文件 4591 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\Ex9_ssd7\application.txt
文件 1987 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\Ex9_ssd7\deadlock.txt
文件 3997 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\Ex9_ssd7\isolation.txt
文件 1507 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise9\Ex9_ssd7\rollback.txt
文件 2584 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise7\relational-model.sql
文件 3263 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise7\relational-schema.txt
文件 6144 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise7\ssd7-ex7.rar
文件 2136 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\Exercise6\normalization.txt
文件 1215 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\exercise5\entityattributes.txt
文件 22276 2011-03-20 21:12 SSD7所有exercise+部分quiz答案\SSD7所有练习答案\exercise5\ER.gif
............此处省略37个文件信息
- 上一篇:FastDFS集群安装所需要的所有文件
- 下一篇:操作系统:原理与实践 第一卷
相关资源
- Python全栈学习笔记面向对象大作业:
- 计算机图形学课设 画板
- 静态网页简单的作业
- 西安电子科技大学 并行计算 霍红卫
- 课程作业:模拟仓库管理系统
- 自己写的航空订票系统c 版--数据结构
- 网页设计作业,旅游网,适合大学生
- 北航人工智能原理课大作业源代码,
- SOCKET 网络编程 计算机网络 作业 客户
- MFC绘图小软件源代码(可当VC大作业用
- 个人网页作业 个人网站
- 大学作业之数学建模锇狼追兔
- 简单计算器的实现(数据结构)
- 简单计算器的实现(数据结构 修正版
- 图像处理作业C 源代码
- 漂亮的网页作业(我的家乡)
- 雷达系统仿真大作业
- 基于S2SH的新闻信息系统
- GPS-RTK、全站仪联合作业在化石沟铜矿
- 浅谈RTK技术与全站仪在露天矿山中的
- GPS-RTK与全站仪联合作业在山谷型采石
- SOPTOOL2014 V3.0
- 基于logisim的8位模型计算机计组大作业
- 作为中转物流平台的趸船作业调度优
- 实训项目计算机数据表示实验56.circ
- 北京航空航天大学研究生数值分析计
- 吴恩达深度学习第一课第四周作业及
- Web大作业 童叟无欺
- 电子科技大学模式识别作业以及答案
- 排队买票多线程问题
评论
共有 条评论