【正文】
har(21) NOT NULL, translator varchar(30), publisher varchar(50) NOT NULL, date smalldatetime NOT NULL, price money NOT NULL ) ( 2)圖書類型表的建立 CREATE TABLE tb_bookType (id int PRIMARY KEY NOT NULL, typeName varchar(20) NOT NULL, days int , fk float 22 ) ( 3)圖書借閱表的建立 CREATE TABLE tb_borrow (id int PRIMARY KEY NOT NULL, bookISBN varchar(13), operatorId int, readerISBN varchar(13), isback int NOT NULL, borrowDate datetime, backDate datetime ) ( 4)圖書操作表的建立 CREATE TABLE tb_operator (id int PRIMARY KEY NOT NULL, name varchar(12) NOT NULL, sex varchar(2) NOT NULL, age int NOT NULL, identityCard varchar(30) NOT NULL, workdate datetime NOT NULL, tel varchar(50) NOT NULL, admin bit NOT NULL, password varchar(10) NOT NULL ) ( 5)訂購單表的建立 CREATE TABLE tb_order (ISBN varchar(13) PRIMARY KEY NOT NULL, date datetime NOT NULL, number int NOT NULL, operator varchar(6) NOT NULL, checkAndAccept int NOT NULL, zk float NOT NULL ) 23 ( 6)讀者信息表的建立 CREATE TABLE tb_reader (name varchar(10) NOT NULL, sex varchar(2) NOT NULL, age int NOT NULL, identityCard varchar(30) NOT NULL, date datetime NOT NULL, maxNum int NOT NULL, tel varchar(50) NOT NULL, keepMoneyNOT money NULL, zj int NOT NULL, zy varchar(50) NOT NULL, readerISBN varchar(13) PRIMARY KEY NOT NULL, bztime datetime NOT NULL ) ( 7)圖書庫存表的建立 CREATE TABLE tb_stockpile (ISBN varchar(13) PRIMARY KEY NOT NULL, amount int ) 24 數(shù)據(jù)庫關(guān)系圖 應(yīng)用程序的調(diào)試 為提高數(shù)據(jù)輸入工作 的效率和質(zhì)量,針對具體的應(yīng)用環(huán)境設(shè)計一個數(shù)據(jù)錄入子系統(tǒng),由計算機(jī)來完成數(shù)據(jù)入庫的任務(wù),與此同時,還要調(diào)試應(yīng)用程序。//判斷是否為普通用戶 if (() != null) { m=1。 } } } private JPasswordField password。 (10)。 26 final JPanel panel_2 = new JPanel()。 (new Dimension(0, 0))。 ()。//設(shè)置密碼框的回顯字符 (new KeyAdapter() { public void keyPressed(final KeyEvent e) { if (() == 10) ()。 (login)。 (true)。 } } ( 2)主菜單 Library /** * 主窗體 * */ public class Library extends JFrame implements ActionListener { private static final JDesktopPane DESKTOP_PANE = new JDesktopPane()。 setSize(800, 600)。 (null)。 getContentPane().add(DESKTOP_PANE)。 (true)。 ImageIcon bookTypeAddicon=()。 (bookBorrowButton)。//創(chuàng)建圖標(biāo)方法 (bookCheckicon)。 JButton readerModiAndDelButton=new 30 JButton()。 (true)。 if(==2){//最高權(quán)限時可用 (true)。 ()。 ()。 // 歸還 ()。 (userManageMItem)。 // 添加借閱管理菜單到菜單欄 (sysManageMenu)。 Connection connection=null。 (this)。 path = new (config + + ).getAbsolutePath()。 (url= + URLName)。 } } private void doRestore(){ try { (USE master)。 } catch (SQLException e) { // TODO Autogenerated catch block (null, 數(shù)據(jù)庫備份失敗+\r\n+())。 // 圖書歸還窗體動作 public static BorrowAction BORROW。 // 圖書信息修改窗體動作 public static BookAddAction BOOK_ADD。 BORROW = new BorrowAction()。 BOOK_ADD = new BookAddAction()。 (更改密碼 , iframe)。 } } } private static class UserModiAction extends AbstractAction { UserModiAction() { super(用戶修改與刪除 , null)。 } private static class PasswordModiAction extends AbstractAction { PasswordModiAction() { putValue(,更改口令 )。 NEWBOOK_ORDER = new BoodOrderAction()。 // 系統(tǒng)退出動作 static { frames = new HashMapString, JInternalFrame()。// 驗收新書動作 public static BoodOrderAction NEWBOOK_ORDER。 } } } ( 3) 內(nèi)部菜單動作 MenuActions /** * 菜單和按鈕的 Action對象 * */ public class MenuActions { private static MapString, JInternalFrame frames。 (null, 數(shù)據(jù)庫恢復(fù)成功 )。 (driverName)。 fin = new (path)。 } private void connect(){ String path。 private JButton getBackupButton() { if (backupButton == null) { backupButton = new JButton()。 } Override public void actionPerformed(ActionEvent e) { // TODO Autogenerated method stub 32 if(().equals(備份與還原 )){ new BackupAndRestore()。 (this)。 // 系統(tǒng)維護(hù) (())。 if(==2){//最高權(quán)限時可用 (true)。 JMenu menu = new JMenu(圖書信息管理 )。 JMenu baseMenu = new JMenu()。 return toolBar。//創(chuàng)建圖標(biāo)方法 (readerModiAndDelicon)。 (bookCheckButton)。 ImageIcon bookOrdericon=()。 (true)。 29 //在工具欄中添加圖書修改與刪除圖標(biāo) JButton bookModiAndDelButton=new JButton()。 (false)。 (().getSize())。 JMenuBar menuBar = createMenu()。//設(shè)置窗體風(fēng)格 new BookLoginIFrame()。 (new Dimension(260, 60))。 27 (new BookResetAction())。 (password)。 (密 碼: )。 (label)。 (5)。 setTitle(圖書館管理系統(tǒng)登錄 )。 private JButton login。 (true)。 ()。根據(jù)系統(tǒng)需要,合并后的 關(guān)系模式不能滿足“新書訂購管理”子系統(tǒng)的需求,因此關(guān)系模式 “圖書訂購”和“庫存管理不能合并”。 在關(guān)系模式 圖書庫存:{ 圖書條形碼、操作員編碼、庫存數(shù)量} 中存在如下函數(shù)依賴 : 圖書條形碼 庫存數(shù)量 圖書條形碼 操作員編碼 為了滿足 2nf,我們把這個表中的操作員編碼去掉,此時也滿足了 3nf,不存在傳遞函數(shù)依賴關(guān)系。 ( 2) 每個書店用戶可以借閱多本圖書。 圖形描述 數(shù)據(jù)流圖 : 頂層圖: 登錄有效登錄新書訂購進(jìn)書單 D e f a u D e f a u l t t e x t D e f a u l t t e x t D e f a D e f a D e f af D e f a D e f au l t D e f a1圖書管理系統(tǒng)讀者 操作員 5 訂購子系統(tǒng) : 進(jìn)書單訂購單3 庫存記錄 24 缺書登記表 211入庫登記12生成訂購單操作員 2 合并后的數(shù)據(jù)流程圖 脫銷借書單進(jìn)書單訂購單登錄無效登錄7檢測有效登錄 8審查9登記缺書3 庫存記錄 2有效借書單 10開借書單4 缺書登記表 2借書單11入庫登記12生成訂購單讀者 2操作員 2讀者 3 6 數(shù)據(jù)字典: 數(shù)據(jù)項 圖書信息表數(shù)據(jù) 項 圖書類別數(shù)據(jù) 項 數(shù)據(jù)項含義 數(shù)據(jù)項名 類型 存儲長度 與其他數(shù)據(jù)項的邏輯關(guān)系 類別編碼 id int 類別名稱 typeName varchar 20 借書天數(shù) days int 4 罰款 fk float 與超出借書天數(shù)( days)的多少有關(guān) 操作員編碼 operatorId int 4 圖書借閱數(shù)據(jù) 項 數(shù)據(jù)項含義 數(shù)據(jù)項名 類型 存儲長度 取值范圍 取值含義 與其他數(shù)據(jù)項的邏輯關(guān)系 借閱號 id int 圖 書條形碼 bookISBN varchar 13 操作員編碼 operatorId int 4 讀者條形碼 readerISBN varchar 13 是否歸還 isback int 4 1, 2 1為不是, 2為是 借閱時間 borrowDate datetime 比歸還時間早 歸還時間 backDate d