第一篇:圖書借閱管理系統(tǒng)數(shù)據(jù)庫要求
圖書借閱管理系統(tǒng)設(shè)計(jì)文檔
學(xué)號(hào):00,姓名:***,班級(jí):*** 一 系統(tǒng)概述
為學(xué)校圖書借閱室設(shè)計(jì)圖書管理系統(tǒng),完成新增圖書上架、讀者辦理圖書借閱證、圖書查詢、借書、還書工作的自動(dòng)處理。
二 需求分析
1. 圖書借閱處理過程簡述
處理過程主要包含:新增圖書上架、辦理圖書借閱證、圖書查詢、借書、還書等。
(1)新增圖書上架
新書上架時(shí),需要登記新書的:書名、作者、出版社、出版時(shí)間(年)、版次、價(jià)格、總冊(cè)數(shù)的信息;并對(duì)圖書統(tǒng)一編號(hào)(書號(hào)為8位數(shù)字)。
(2)辦理圖書借閱證
讀者辦理借書證時(shí),需要登記讀者(學(xué)生)的學(xué)號(hào)(6位)、姓名、班級(jí)、掃描學(xué)生證照片,并對(duì)借書證統(tǒng)一編號(hào)(借書證號(hào)為6位數(shù)字,值與學(xué)號(hào)相同)。
(3)圖書查詢
讀者可以按照書名、作者、出版社查詢圖書基本信息,并可以得知現(xiàn)還有幾冊(cè)可以借閱。
(4)借書
每個(gè)學(xué)生讀者最多借3本書;借書時(shí)間為2周,如果有超期未還的圖書則不能再借書。讀者借書時(shí),應(yīng)登記借書證號(hào)、書號(hào)、借書日期(年月日);并打印借書條交給讀者,借書條上包括借書證號(hào)、所借各本書的書名、應(yīng)還書的時(shí)間。
(5)還書 讀者還書時(shí),應(yīng)查看是否超期,如果超期則每天罰款0.1元,計(jì)算出應(yīng)交罰款。
2. 數(shù)據(jù)分析
數(shù)據(jù)處理過程中涉及到兩個(gè)實(shí)體:圖書和讀者;各實(shí)體應(yīng)具有的屬性如下: 圖書(。。)讀者(。。)
由于同一種圖書可以有多冊(cè)上架,每個(gè)讀者最多可以借閱3本書,所以圖書和讀者之間是多對(duì)多的關(guān)系;為了表示多對(duì)多關(guān)系,應(yīng)將圖書借閱定為實(shí)體,構(gòu)造兩個(gè)一對(duì)多關(guān)系。圖書借閱的屬性如下: 借閱(。。)
三、數(shù)據(jù)庫設(shè)計(jì)
1.?dāng)?shù)據(jù)庫
數(shù)據(jù)庫名稱為*** 2.E-R圖
3.表結(jié)構(gòu)
數(shù)據(jù)庫中包含三個(gè)表:圖書表、讀者表和借閱表,各表結(jié)構(gòu)如下:
4.建表語句
第二篇:圖書借閱管理系統(tǒng)
任 務(wù) 書
1、課程設(shè)計(jì)題目
圖書借閱管理系統(tǒng)
2、設(shè)計(jì)任務(wù)和內(nèi)容
一個(gè)通用的圖書借閱管理系統(tǒng)是圖書管理系統(tǒng)的一個(gè)子系統(tǒng),該應(yīng)用系統(tǒng)應(yīng)能對(duì)圖書館的圖書入庫、借出、歸還進(jìn)行操作。在圖書、讀者信息等基礎(chǔ)數(shù)據(jù)的基礎(chǔ)上,完成以上的操作。同時(shí)能夠?qū)D書按出版社、類別進(jìn)行分類統(tǒng)計(jì),能夠統(tǒng)計(jì)圖書借閱情況狀態(tài)、讀者借閱情況。
本課題任務(wù)是開發(fā)一個(gè)小型通用的圖書借閱管理系統(tǒng),并撰寫符合規(guī)范的課程設(shè)計(jì)說明書以體現(xiàn)設(shè)計(jì)過程和設(shè)計(jì)結(jié)果。
3、設(shè)計(jì)步驟和要求
設(shè)計(jì)步驟:
首先進(jìn)行相關(guān)資料查閱和學(xué)習(xí),了解基本的業(yè)務(wù)流程和系統(tǒng)數(shù)據(jù)功能要求。然后結(jié)合軟件工程的理論和教材中數(shù)據(jù)庫設(shè)計(jì)的六個(gè)階段(重點(diǎn)是前三個(gè)階段)完成設(shè)計(jì)任務(wù),即系統(tǒng)結(jié)構(gòu)設(shè)計(jì)(需求分析、概念結(jié)構(gòu)設(shè)計(jì)、邏輯結(jié)構(gòu)設(shè)計(jì)、物理結(jié)構(gòu)設(shè)計(jì))和系統(tǒng)功能設(shè)計(jì)。
設(shè)計(jì)要求:
1、撰寫課程設(shè)計(jì)說明書。其要求如下:
(1)基本要求:
① 能反映完成了上述設(shè)計(jì)內(nèi)容要求。
② 要求撰寫不少于5000個(gè)文字(20頁)的文檔。
③ 文檔中至少要包括:數(shù)據(jù)流圖、數(shù)據(jù)字典、E-R圖、數(shù)據(jù)庫表的詳細(xì) 說明、系統(tǒng)功能結(jié)構(gòu)圖、主要功能模塊說明。
④ 課程設(shè)計(jì)說明書一律用碳素墨水書寫,其中用戶界面設(shè)計(jì)可以附界面 的計(jì)算機(jī)截圖或手工繪圖。
(2)文檔格式要求(遵循數(shù)據(jù)庫原理及應(yīng)用課程設(shè)計(jì)大綱上的要求)其中,正文部分:
①分章、層次等,每一章從新一頁開始。
②章節(jié)安排可如下安排
.概述:包括項(xiàng)目背景、編寫目的、軟件定義、開發(fā)環(huán)境等內(nèi)容。.需求分析:問題陳述、需完成的功能。以數(shù)據(jù)流圖和數(shù)據(jù)字典表達(dá)。
.概念結(jié)構(gòu)設(shè)計(jì):將上述需求分析的成果抽象為ER模型圖。
.邏輯結(jié)構(gòu)設(shè)計(jì):把ER模型圖轉(zhuǎn)換為關(guān)系表;描述每一個(gè)基本表關(guān)
系。并進(jìn)行規(guī)范化;定義視圖、定義索引、主關(guān)鍵字、定義權(quán)限。.軟件功能設(shè)計(jì):畫出系統(tǒng)功能結(jié)構(gòu)圖,描述每個(gè)功能所完成的任務(wù)。.代碼設(shè)計(jì)和界面設(shè)計(jì):給出主要功能的代碼并有適當(dāng)?shù)恼f明;界面
設(shè)計(jì)要合理,給出主要界面。
2、一個(gè)可運(yùn)行的圖書借閱管理系統(tǒng)原型。(根據(jù)學(xué)分制的實(shí)際情況該要求為部分專業(yè)學(xué)生的要求,其他專業(yè)學(xué)生為可選要求)
教師簽名:
第三篇:圖書管理系統(tǒng)數(shù)據(jù)庫設(shè)計(jì)
數(shù)據(jù)庫設(shè)計(jì).................................................................2 3.1 專門術(shù)語的定義...................................................2 3.1.1 系統(tǒng)中常用的術(shù)語(或使用頻率較高的術(shù)語).........................2 3.1.2 表格定義及規(guī)范.................................................2 3.1.2.1數(shù)據(jù)約定.....................................................2 3.1.2.2表和表字段命名規(guī)范:.........................................3 3.2 數(shù)據(jù)設(shè)計(jì).........................................................3 3.2.1 數(shù)據(jù)流程圖設(shè)計(jì).................................................3 3.2.2實(shí)體關(guān)系結(jié)構(gòu)設(shè)計(jì)...............................................4 3.3安全保密設(shè)計(jì).....................................................6 3.3.1 邏輯上的安全保密...............................................6 3.3.2 物理上的安全保密...............................................6 3.4 表格與功能模塊相關(guān)性分析.........................................7 3.5 表格定義.........................................................7 數(shù)據(jù)庫設(shè)計(jì)
3.1 專門術(shù)語的定義
暫無
3.1.1 系統(tǒng)中常用的術(shù)語(或使用頻率較高的術(shù)語)暫無
3.1.2 表格定義及規(guī)范 3.1.2.1數(shù)據(jù)約定
所有數(shù)據(jù)項(xiàng)都用英文、漢語拼音或縮寫表示,數(shù)據(jù)庫名稱除外。
所有字段在設(shè)計(jì)時(shí),除以下數(shù)據(jù)類型timestamp、image、datetime、smalldatetime、uniqueidentifier、binary、sql_variant、binary、varbinary外,必須有默認(rèn)值。字符型的默認(rèn)值為一個(gè)空字符值串;數(shù)值型的默認(rèn)值為數(shù)值0;邏輯型的默認(rèn)值為數(shù)值0;
其中:系統(tǒng)中所有邏輯型中數(shù)值0表示為“假”;數(shù)值1表示為“真”。datetime、smalldatetime類型的字段沒有默認(rèn)值,必須為NULL。當(dāng)字段定義為字符串形時(shí)建議使用varchar而不用nvarchar。建議在大多數(shù)表中(如報(bào)銷單,申請(qǐng)單),應(yīng)都有以下字段: 字段名說明類型默認(rèn)值 CreatorID創(chuàng)建者int CreatedTime創(chuàng)建時(shí)間DatetimeNULL 字符集采用 UTF-8,請(qǐng)注意字符的轉(zhuǎn)換。
所有數(shù)據(jù)表第一個(gè)字段都是系統(tǒng)內(nèi)部使用自動(dòng)序列主鍵列,自增字段,不可空,名稱為:id,確保不把此字段暴露給最終用戶。
除特別說明外,所有字符串字段都采用varchar(50)類型,(無論漢字還是英文,都算一個(gè)字符)。
除特別說明外,所有小數(shù)的字段都采用 decimal(18,2)的形式表達(dá)。
除特別說明外,所有日期格式都采用 datetime 格式(根據(jù)需要提取時(shí)間格式); 除特別說明外,所有整形都采用 bigint 格式。除特別說明外,所有字段默認(rèn)都設(shè)置為 null。3.1.2.2表和表字段命名規(guī)范:
命名規(guī)則約束的范圍包括:數(shù)據(jù)庫的命名、表的命名及字段的命名。數(shù)據(jù)庫相關(guān)的命名規(guī)則采用與通常的編程的變量命名規(guī)則原則一致,具體要求如下: 1)字段名及表名為典型的名詞結(jié)構(gòu); 2)中文名稱要求語言精練、文法嚴(yán)謹(jǐn);
3)望文知意、易懂易用,禁止采用如:A002這種命名;
4)主體采用拼音字母的首寫字母拼寫構(gòu)成,基于慣常法可適度采用無詞義歧義性的英文命名;
5)長度不少于3個(gè)字母,不大于12個(gè)字母;
6)在對(duì)于拼音首字母類似的字段和表,為區(qū)別,添加下劃線和數(shù)字如男性人數(shù):NXRS,女性人數(shù):NXRS_2。
3.2 數(shù)據(jù)設(shè)計(jì)
繪制數(shù)據(jù)流程圖的目的是為了方便開發(fā)人員與用戶的交流,以及為系統(tǒng)的設(shè)計(jì)提供依據(jù)。數(shù)據(jù)流程圖的繪制過程通常采用自頂向下,逐層分解,直到功能細(xì)化為止,形成若干層次的數(shù)據(jù)流程圖。3.2.1 數(shù)據(jù)流程圖設(shè)計(jì)
0層數(shù)據(jù)流圖
1層數(shù)據(jù)流圖
3.2.2實(shí)體關(guān)系結(jié)構(gòu)設(shè)計(jì)
圖書實(shí)體關(guān)系
讀者實(shí)體關(guān)系
圖書借閱關(guān)系實(shí)體
用戶實(shí)體關(guān)系
圖書類別實(shí)體關(guān)系
3.3安全保密設(shè)計(jì)
3.3.1 邏輯上的安全保密
1、系統(tǒng)對(duì)非法使用者的安全保密處理措施
2、系統(tǒng)對(duì)正常使用者的安全保密處理措施
3、系統(tǒng)對(duì)管理員的安全保密 3.3.2 物理上的安全保密
1、數(shù)據(jù)庫系統(tǒng)異常時(shí)的還原處理措施
2、設(shè)備遭異常毀壞時(shí)的安全防護(hù)措施
3、數(shù)據(jù)參數(shù)做到及時(shí)更新,保證系統(tǒng)正常運(yùn)行
3.4 表格與功能模塊相關(guān)性分析
3.5 表格定義
a.圖書信息表
b.讀者信息表
c.借閱表
d.管理員_書籍
e.管理員_學(xué)生
第四篇:圖書管理系統(tǒng)數(shù)據(jù)庫源代碼
圖書管理系統(tǒng)數(shù)據(jù)庫源代碼
//創(chuàng)建工程及設(shè)計(jì)主界面
public class Main extends JFrame { private static final JDesktopPane {
DESKTOP_PANE=new JDesktopPane();
//桌面窗體
} public static void main(String[] args)
//入口方法
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());//設(shè)置系統(tǒng)界面外觀
new BookLogin();
//登錄窗口
}
catch(Exception ex)
{
ex.printStackTrace();
} } public static void addIFame(JInternalFrame iframe)
//添加子窗體的方法
{
DESKTOP_PANE.add(iframe);
//新增子窗體
} public Main(){
super();
//設(shè)置“關(guān)閉”按鈕處理事件
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
//創(chuàng)建工具欄
Toolkit tool=Toolkit,getDefaultToolkit();
//獲得屏幕大小
Dimension screenSize=tool.getScreenSize();
setSize(800,600);
//設(shè)置窗體大小
setLocation((screenSize.width-getWidth())/2,(screenSize.height-getHeight())/2;//設(shè)置窗體位置
setTitle(“圖書管理系統(tǒng)”);
//設(shè)置窗體標(biāo)題
JMenuBar menuBar=createMenu();
//創(chuàng)建菜單欄
setJMenuBar(menuBar);
//設(shè)置菜單欄
JToolBar toolBar=createToolBar();
//創(chuàng)建工具欄的方法
getContentPane(),add(toolBar,BorderLayout.NORTH);
//設(shè)置工具欄
final JLable lable=new JLable();
//創(chuàng)建一個(gè)標(biāo)簽,用來顯示圖片
lable.setBounds(0,0,0,0);
//設(shè)置窗體的大小和位置
lable.setIcon(null);
//窗體背景
DESKTOP_PANE.addComponentListener(new ComponentAdapter())
{
public void componentResized(final ComponentEvent e)
{
Dimension size=e.getComponent().getSize();
//獲得組建大小
lable.setSize(e.getComponent().getSize());
//設(shè)置標(biāo)簽大小
lable.setText(“”);
//設(shè)置標(biāo)簽文本,設(shè)置窗口背景
}
}
//將標(biāo)簽添加到桌面窗體
DESKTOP_PANE.add(lable,new Integer(Integer.MIN_VALUE));
getContentPane().add(DESKTOP_PANE);
//將桌面窗體添加到主窗體中
} } private JToolBar createToolBar()
//創(chuàng)建工具欄的方法 { JToolBar toolBar=new JToolBar();
//初始化工具欄
toolBar.setFloatable(false);
//設(shè)置是否可以移動(dòng)工具欄
toolBar.setBorder(new BevelBorder(BevelBorder.RAIZED));
//設(shè)置邊框
//圖書信息添加按鈕
JButton bookAddButton=new JButton(MenuActions.BOOK_ADD);ImageIcon icon=new ImageIcon(Main.class.getResource(“/bookAddtb.jpg”));//添加菜單欄圖標(biāo)
bookAddButton.setIcon(icon);
//設(shè)置按鈕圖標(biāo)
bookAddButton.setHideActionText(true);
//顯示提示文本
toolBar.add(bookAddButton);
//添加到工具欄中
JButton bookModiAndDelButton=new JButton(MenuActions.BOOK_MODIFY);
//圖書信息修改按鈕
ImageIcon bookmodiicon=Icon.add(“bookModiAndDeltb.jpg”);
//創(chuàng)建圖表方法
bookModiAndDelButton.setIcon(bookmodiicon);
//設(shè)置按鈕圖標(biāo)
bookModiAndDelButton.setHideActionText(true);
//顯示提示文本
toolBar.add(bookModiAndDelButton);
//添加到工具欄
JButton bookTypeAddButton=new JButton(MenuActions.BOOKTYPE_ADD);
//圖書類別添加按鈕
ImageIcon bookTypeAddicon=Icon.add(“bookTypeAddtb.jpg”);
//創(chuàng)建圖標(biāo)方法
bookTypeAddButton.setIcon(bookTypeAddicon);
//設(shè)置按鈕圖標(biāo)
bookTypeAddButton.setHideActionText(true);
//顯示提示文本
toolBar.add(bookTypeAddButton);
//添加到工具欄
JButton bookBorrowButton=new JButton(MenuActions.BORROW);
//圖書借閱按鈕
ImageIcon bookBorrowicon=Icon.add(“bookBorrowtb.jpg”);
//創(chuàng)建圖標(biāo)方法
bookBorrowButton.setIcon(bookBorrowicon);
//設(shè)置按鈕圖標(biāo)
bookBorrowButton.setHideActionText(true);
//顯示提示文本
toolBar.add(bookBorrowButton);
//添加到工具欄
JButton bookOrderButton=new JButton(MenuActions.NEWBOOK_ORDER);
//新書訂購按鈕
ImageIcon bookOrdericon=Icon.add(“bookOrdertb.jpg”);
//創(chuàng)建圖標(biāo)方法
bookOrderButton.setIcon(bookOrdericon);
//設(shè)置按鈕圖標(biāo)
bookOrderButton.setHideActionText(true);
//顯示提示文本
toolBar.add(bookOrderButton);
//添加到工具欄
JButton bookCheckButton=new JButton(MenuActions.NEWBOOK_CHECK);
//驗(yàn)收新書按鈕
ImageIcon bookCheckicon=Icon.add(“newbookChecktb.jpg”);
//創(chuàng)建圖標(biāo)方法
bookCheckButton.setIcon(bookCheckicon);
//設(shè)置按鈕圖標(biāo)
bookCheckButton.setHideActionText(true);
//顯示提示文本
toolBar.add(bookCheckButton);
//添加到工具欄
JButton readerAddButton=new JButton(MenuActions.READER_ADD);
//讀者信息添加按鈕
ImageIcon readerAddicon=Icon.add(“readerAddtb.jpg”);
//創(chuàng)建圖標(biāo)方法
readerAddButton.setIcon(readerAddicon);
//設(shè)置按鈕圖標(biāo)
readerAddButton.setHideActionText(true);
//顯示提示文本
toolBar.add(readerAddButton);
//添加到工具欄
JButton readerModiAndDelButton=new JButton(MenuActions.READER_MODIFY);
//讀者信息修改按鈕
ImageIcon readerModiAndDelicon=Icon.add(“readerModiAndDeltb.jpg”);
//創(chuàng)建圖標(biāo)方法
readerModiAndDelButton.setIcon(readerModiAndDelicon);
//設(shè)置按鈕圖標(biāo)
readerModiAndDelButton.setHideActionText(true);
//顯示提示文本
toolBar.add(readerModiAndDelButton);
//添加到工具欄
JButton ExitButton=new JButton(MenuActions.EXIT);
//退出系統(tǒng)按鈕
ImageIcon Exiticon=Icon.add(“exittb.jpg”);
//創(chuàng)建圖標(biāo)方法
ExitButton.setIcon(Exiticon);
//設(shè)置按鈕圖標(biāo)
ExitButton.setHideActionText(true);
//顯示提示文本
toolBar.add(ExitButton);
//添加到工具欄
return toolBar;} public class Business { protected static String dbClassName=“com.mysql.jdbc.Driver”;
//數(shù)據(jù)庫驅(qū)動(dòng)類
protected static String dbUr1=“jdbc:mysql://localhost/ts”;
//連接URL protected static String dbUser=“root”;
//數(shù)據(jù)庫用戶名
protected static String dbpwd=“root”;
//數(shù)據(jù)庫密碼
private static Connection conn=null;
//數(shù)據(jù)庫連接對(duì)象,初值為null public Business(){
try
{
if(coon==null)
//連接對(duì)象為空
{
Class.forName(dbClassName);
//加載驅(qū)動(dòng)類信息
conn=DriverManager.getConnection(dbUr1,dbUser,dbPwd);
//建立連接對(duì)象
}
}
catch(Exception ee)
{
ee.printStackTrace();
} } public static ResultSet executeQuery(String sql)
//執(zhí)行查詢方法
{
try
{
//如果連接對(duì)象為空,則重新調(diào)用構(gòu)造方法
if(conn==null)
{
new Business();
return conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE).executeQuery(sql);
//執(zhí)行查詢
}
}
catch(SQLException e)
{
e.printStackTrace();
return null;
//返回null值
}
finally
{} } public static int executeUpdata(String sql)
//更新方法
{
try
{
if(conn==null)
{
new Business();
//如果連接對(duì)象為空,則重新調(diào)用構(gòu)造方法
return conn.createStatement().executeUpdate(sql);//執(zhí)行更新
}
}
catch(SQLException e)
{
e.printStackTrace();
return-1;
}
finally
{} } public static void close()
//關(guān)閉方法 {
try
{
conn.close();
//關(guān)閉連接對(duì)象
}
catch(SQLException e)
{
e.printStackTrace();
}
finally
{
conn=null;
//設(shè)置連接對(duì)象為null值
} } }
//為數(shù)據(jù)庫添加對(duì)應(yīng)的類 public class BookInfo { private String Book_id;
//圖書編號(hào)
private String typeid;
//類別編號(hào)
private String writer;
//作者
private String translator;//譯者
private String publisher;
//出版社
private Date date;
//出版日期
private Double price;
//圖書單價(jià)
private String getBookname;//圖書名稱
public String getBookname(){
return bookname;} public void setBookname(String bookname){
this.bookname=bookname;} public Date getDate(){
return date;} public void setDate(Date date){
this.date=date;} public string getBook_id()
{ return Book_id;} public void setBook_id(String Book_id){ this.Book_id=Book_id;} public Double getPrice(){ return price;} public void setprice(Double price){ this.price=price;} public String getPublisher(){ return Publisher;} public void setPublisher(String publisher){ this.Publisher=Publisher;} public String getTranslator(){ return translator;} public void setTranslator(String translator){ this.translator=translator;} public String getTypeid(){ return typeid;} public void setTypeid(String typeid){ this.typeid=typeid;} public String getWriter(){ return writer;} public void setWriter(String writer){
this.writer=writer;} } public class BookType
//圖書列表信息類 { private String id;
//圖書類別編號(hào)
private String typeName;
//圖書類別名稱
private String days;
//可解天數(shù)
private String fk;//每罰款金額
public String getFk(){
return fk;} public void setFk(String fk){
this.fk=fk;} public String getDays(){
return days;} public void setDays(String days){
this.days=days;} public string getId(){
return id;} public void setId(String id){
this.Bid=id;} public String getTypeName(){
return typeName;} public void setTypeName(String typeName){
this.typeName=typeName;} } public class Order
//圖書訂單信息類 {
private String Book_id;
//圖書編號(hào) private Date date;
//下單時(shí)間 private String number;
//圖書數(shù)量 private String operator;//操作員
private String checkAndAccept;
//是否收到貨 private String zk;
//圖書折扣 public String getcheckAndAccept(){ return checkAndAccept;} public void setcheckAndAccept(String checkAndAccept){ this.checkAndAccept=checkAndAccept;} public Date getDate(){ return date;} public void setDate(Date date){ this.date=date;} public string getBook_id(){ return book_id;} public void setBook_id(String book_id){ this.book_id=book_id;} public String getNumber(){ return number;} public void setNumber(String number){ this.number=number;} public String getOperator(){ return operator;} public void setOperator(String operator){
this.operatorr=operator;
} public String getZk(){
return zk;} public void setZk(String Zk){
this.zk=zk;} } public class Operater { private String id;
//操作員編號(hào)
private String name;
//操作員用戶名
private String grade;
//操作員等級(jí)
private String password;//操作員密碼
private String type;
//出版社
public String getType(){
return type;} public void setType(String type){
this.type=type;} public string getGrade(){
return grade;} public void setGrade(String grade){
this.grade=grade;} public String getId(){
return id;} public void setId(String id){
this.id=id;} public String getName(){
return name;} public void setName(String name){
this.name=name;} public String getPassword(){
return password;} public void setPassword(String password){
this.password=password;} } public class Borrow
//書籍借閱信息類 { private int id;
//借閱編號(hào)
private String book_id;
//圖書編號(hào)
private String reader_id;
//讀者編號(hào)
private String num;
//借書數(shù)量
private String borrowDate;
//借書日期
private String backDate;
//應(yīng)還日期
private String Bookname;//圖書名稱
public String getBookname(){
return bookname;} public void setBookname(String bookname){
this.bookname=bookname;} public string getBackDate(){
return backDate;} public void setBackDate(String backDate){
this.backDate=backDate;} public string getBorrowDate(){
return borrowDate;} public void setBorrowDate(String borrowDate){
this.borrowDate=borrowDate;} public String getNum(){
return num;} public void setNum(String num){
this.num=num;} public String getBook_id(){
return book_id;} public void setBook_id(String book_id){
this.book_id=book_id;} public String getReader_id(){
return reader_id;} public void setReader_id(String reader_id){
this.reader_id=reader_id;} public int getId(){
return id;} public void setId(Int id){
this.id=id;} } public class Back
//圖書歸還信息類 { private String book_id;
//圖書編號(hào)
private String bookname;
//圖書名稱
private String operatorId;
//操作員編號(hào)
private String borrowDate;//圖書借閱時(shí)間
private String backDate;
//圖書歸還時(shí)間 private String readerName;
//讀者姓名 private String reader_id;//讀者編號(hào) private int typeId;private int id; public int getId(){ return id;} public void setId(int id){ this.id=id;} public int getTypeId(){ return typeid;} public void setTypeId(int typeid){ this.typeId=typeId;} public string getBackDate(){ return backDate;} public void setBackDate(String backDate){ this.backDate=backDate;} public String getBookname(){ return bookname;} public void setBookname(String bookname){ this.bookname=bookname;} public string getBorrowDate(){ return borrowDate;} public void setBorrowDate(String borrowDate){ this.borrowDate=borrowDate;} public String getOperatorId(){
return operatorId;} public void setOperatorId(String operatorId){
this.operatorId=operatorId;} public String getBook_id(){
return book_id;} public void setBook_id(String book_id){
this.book_id=book_id;}
public String getReader_id(){
return reader_id;} public void setReader_id(String reader_id){
this.reader_id=reader_id;}
public String getReaderName(){
return readerName;} public void setReaderName(String readerName){
this.readerName=readerName;} }
//系統(tǒng)登錄模塊設(shè)計(jì)
public class BookLogin extends JFrame { private static final Operater Type=null;
//人員類型
private static Operater user;
//用戶名
private JPasswordField password;private JTextField username;private JButton login;private JButton reset;public BookLogin(){
super();
final BorderLayout borderLayout=new BorderLayout();
//創(chuàng)建布局管理器
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//設(shè)置“關(guān)閉”按鈕處理事件
borderLayout.setVgap(10);
//設(shè)置組件間的垂直關(guān)系
getContentPane().setLayout(borderLayout);
//使用布局管理器
setTitle(“圖書管理系統(tǒng)登錄”)
//設(shè)置窗體標(biāo)題
Toolkit tool=Toolkit.getDefaultToolkit();
//獲得默認(rèn)的工具箱
Dimension screenSize=tool.getScreenSize();//獲得屏幕的大小
setSize(285,194);
setLocation((screenSize.width-getWidth())/2,(screenSize.height-getHeight())/2);//設(shè)置窗體位置
final JPanel mainPanel=new JPanel();
//創(chuàng)建主面板
mainPanel.setLayout(new BorderLayout());
//設(shè)置邊框布局
mainPanel.setBorder(new EmptyBorder(0,0,0,0))
//設(shè)置邊框?yàn)?
getContentPane().add(mainPanel);
//在窗體中加入主面板
final JLabel imageLabel=new JLabel;
//創(chuàng)建一個(gè)標(biāo)簽,用來顯示圖片
ImageIcon loginIcon=Icon.add(“l(fā)ogin.jpg”);
//創(chuàng)建一個(gè)圖像圖標(biāo)
imagelabel.setIcon(loginIcon);
//設(shè)置圖片
imageLabel.setOpaque(true);
//設(shè)置繪制其邊界內(nèi)的所有像素
imageLabel.setBackground(Color.GREEN);
//設(shè)置背景顏色
imageLabel.setpreferredSize(new Dimension(260,60));//設(shè)置標(biāo)簽大小
mainPanel.add(imageLabel,BorderLayout.NORTH);
//添加標(biāo)簽到主面板
final JPanel centerPanel=new JPanel();
//添加一個(gè)中心面板
final GridLayout gridLayout=new GridLayout(2,2);//創(chuàng)建網(wǎng)絡(luò)布局管理器
gridLayout.setHgap(5);
//設(shè)置組件之間平行的距離
gridLayout.setVgap(20);
//設(shè)置組件之間垂直的距離
centerPanel.setLayout(gridLayout);
//使用布局管理器
mainPanel.add(centerPanel);
//添加到主桌面
final JLabel userNamelabel=new JLabel();
//創(chuàng)建一個(gè)標(biāo)簽
userNameLabel.setHorizontalAlignment(SwingConstants.CENTER);//設(shè)置對(duì)齊方式
userNameLabel.setPreferredSize(new Dimension(0,0));
//設(shè)置組件大小
userNameLabel.setMinimumSize(new Dimension(0,0));
//設(shè)置組件最小的大小
centerPanel.add(userNameLabel);
//添加到中心面板
userNameLabel.setText(“用
戶
名:”);
//設(shè)置標(biāo)簽文本
username=new JTextField(20);
//創(chuàng)建文本框
username.setPreferredSize(new Dimension(0,0));
//設(shè)置組件大小
centerPanel.add(username);
//添加到中心面板
final JLabel passwordLabel=new JLabel();
//創(chuàng)建一個(gè)標(biāo)簽
passwordLabel.setHorizontalAlignment(SwingConstants.CENTER);
//設(shè)置對(duì)齊方式
centerPanel.add(passwordLabel);
//添加到中心面板
passwordLabel.setText(“密
碼:”);
//設(shè)置標(biāo)簽文本
password=new JPasswordField(20);
//創(chuàng)建密碼框
password.setDocument(new Document(6));
//設(shè)置密碼長度為6
password.addKeyListener(new KeyAdapter()
//監(jiān)聽密碼框
{
public void keyPressed(final keyEvent e)
//監(jiān)聽鍵盤案件事件
{
if(e.getKeyCode()==10)
//如果按了回車鍵
{
login.doClick();
//進(jìn)行登錄
}
}
})
centerPanel.add(password);
//添加到中心面板
final JPanel southPanel=new JPanel;//新增一個(gè)底部面板
mainPanel.add(southPanel,BorderLayout.SOUTH);
//添加到主面板中
login=new JButton();
//創(chuàng)建按鈕組件
login.addActionListener(new BookLoginAtion());
//添加監(jiān)聽器
login.setText(“登錄”);
//設(shè)置按鈕文本
southPanel.add(login);
//把按鈕添加到底部面板
reset=new JButton();
//創(chuàng)建按鈕組件
reset.addActionListener(new BookResetAction());
//添加監(jiān)聽器
reset.setText(“重置”);
//設(shè)置按鈕文本
southPanel.add(reset);
//把按鈕添加到底部面板
setVisible(true);
//設(shè)置創(chuàng)建可見
setResizable(false);
//設(shè)置窗體不可改變大小
} public static Operater getUser(){
return user;} public static Operater getType(){
return Type;} public static void setUser(Operater user){
BookLogin.user=user;} } private class BookResetAction implements ActionListener { public void actionPerformed(final ActionEvent e){
username.setText(“");//設(shè)置用戶名輸入框?yàn)榭?/p>
password.setText(”“);//設(shè)置密碼輸入框?yàn)榭?/p>
} } private class BookLoginAction implements ActionListener { public void actionPerformed(final ActionEvent e){
user=Business.check(username.getText(),new String(password.getPassword()));//調(diào)用business方法
if(user.getName()!=null)
//判斷用戶名是否為null
{
try
{
Main frame=new Main();
//創(chuàng)建一個(gè)主窗體
frame.setVisible(true);
//設(shè)置其可見
BookLogin.this.setVisible(false);
//設(shè)置登錄窗體為不顯示
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,”請(qǐng)輸入正確的用戶名和密碼!“);//彈出提示框
username.setText(”“);
//設(shè)置用戶名輸入框?yàn)榭?/p>
password.setText(”“);
//設(shè)置密碼輸入框?yàn)榭?/p>
} } }
//基本信息管理模塊
public class ReaderAdd extends JInternalFrame
//添加讀者信息 { public ReaderAdd(){
super();
setTitle(”讀者相關(guān)信息添加“);
setIconifiable(true);
//設(shè)置窗體可最小化
setClosable(true);
//設(shè)置窗體可關(guān)閉
setBounds(100,100,500,350);
final JLabel logoLabel=new JLabel();
ImageIcon readerAddIcon=Icon.add(”readerAdd.jpg“);
logoLabel.setIcon(readerAddIcon);
logoLabel.setOpaque(true);
logoLabel.setBackground(Color.CYAN);
logoLabel.setPreferredSize(new Dimension(400,60));
getContentPane().add(logoLabel,BorderLayout.NORTH);
final JPanel panel=new JPanel();
panel.setLayout(new FlowLayout());
getContentPane().add(panel);
final JPanel panel_1=new JPanel();
final GridLayout gridLayout=new GridLayout(0,4);
gridLayout.setVgap(15);
gridLayout.setHgap(15);
panel_1.setLayout(gridLayout);
panel_1.setPreferredSize(new Dimension(450,200));
panel.add(panel_1);
final JLabel label_2=new JLabel();
label_2.setText(”姓名:“);
panel_1.add(label_2);
readername=new JTextField();
readername.setDocument(new Document(10));
panel_1.add(readername);
final JLabel label_3=new JLabel();
public void actionPerformed(final ActionEvent e)
{
Check validator=new Check();
//校驗(yàn)類
String zj=String.valueof(comboBox.getSelectedIndex());
String id=read_id.getText().trim();
Vector v1=new Vector();
v1.clear();
v1.add(”reader“);
//讀取配置文件中相應(yīng)的查詢語句
v1.add(id);
if(l==validator.Validate(V1))
//檢查是否存在該讀者
{
JOptionPane.showMessageDialog(null,”添加失敗,該讀者編號(hào)已存在!“);
}
else
{
Int i=Business.InsertReader(readername.getText().trim(),sex.trim(),age.getText().trim(),zjnumber.getText().trim(),Date.valueOf(date.getText().trim()),maxnumber.getText().trim().tel.getText().trim(),Double.valueof(keepmoney.getText().trim()),zj,zy.getText().trim(),Date.valueOf(bztime.getText().trim()),read_id.getText().trim());
if(i==1)
{
JOptionPane.showMessageDialog(null,”添加成功!“);
doDefaultCloseAction();
}
}
}
}
class TelListener extends KeyAdapter
{ public void keyTyped(KeyEvent e){
String numStr=”0123456789-“+(char)8;
//類型轉(zhuǎn)換
if(numStr.indexOf(e.getKeyChar())<0)
{
e.consume();
} }
}
//添加“關(guān)閉”按鈕的事件監(jiān)聽器
class CloseActionListener implements ActionListener
{
public void actionPerformed(final ActionEvent e)
{
doDefaultCloseAction();
}
}
private String[] columnNames(”名稱“,”性別“,”年齡“,”證件號(hào)碼“,”借書證有效日期“,”借書量“,”電話“,”押金“,”證件“,”職業(yè)“,”讀者編號(hào)“,”辦證時(shí)間“);
private String[] array=new String[]{”身份證“,”軍人證“,”學(xué)生證“};
String id;
private Object[][] getFileStates(List list)
{
Object[][]results=new Object[list.size()][columnNames.length];
for(int i=0;i { Reader reader=(Reader)list.get(i); result[i][0]=reader.getName(); //定義二維數(shù)組 String sex; if(reader.getSex().equals(”1“)) { sex=”男“; } else { sex=”女“; } results[i][1]=sex; //讀取讀者歌屬性值 results[i][2]=reader.getAge(); results[i][3]=reader.getIdentityCard(); results[i][4]=reader.getDate(); results[i][5]=reader.getMaxNum(); results[i][6]=reader.getTel(); results[i][7]=reader.getKeepMoney(); results[i][8]=array[reader.getZj()]; results[i][9]=reader.getZy(); results[i][10]=reader.getBook_id(); results[i][11]=reader.getBZtime(); } return results; } //圖書類別管理 //添加圖書信息 utton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { if(bookTypeName.getText().length()==0) { JOptionPane.showMMessageDialog(null,”圖書類別文本框不可為空“); return; } if(days.getText().length()==0) { JOptionPane.showMessageDialog(null,”可借天數(shù)文本框不可為空“); return; } if(!check.isNumeric(days.getText().trim())) { JOptionPane.showMessageDialog(null,”可借天數(shù)必須為數(shù)字“); return; } if(fakuan.getText().length()==0) { JOptionPane.showMessageDialog(null,”罰款文本框不可為空“); return; } if(!check.isNumeric(fakuan.getText().trim())) { JOptionPane.showMessageDialog(null,”罰款必須為數(shù)字“); return; } int i=Business.InsertBookType(bookTypeName.getText().trim(),days.getText().trim(),Double.valueof(fakuan.getText.trim())/10); if(i==1) { JOptionPane.showMessageDialog(null,”添加成功!“); doDefaultCloseAction(); } } }); panel_6.add(button); final JButton buttonDel=new JButton(); buttonDel.setText(”關(guān)閉“); buttonDel.addActionListener(new ActionListener(){ public void actionPerformed(final ActionEvent e){ doDefaultCloseAction(); } }); panel_6.add(buttonDel); setVisibel(true);} //修改圖書類 class ButtonAddListener implements ActionListener{ public void actionPerformed(ActionEvent e){ Object selectedItem=bookTypeModel.getSelectedItem(); int i=Business.UpdatebookType(BookTypeId.getText().trim(),selectedItem.toString(),days.getText().trim(),fk.getText().trim()); if(i==1) { JOptionPane.showMessageDialog(null,”修改成功"); object[][] results=getFileStates(Business.selectBookCategory()); model.setDataVector(results.columnNames); } } } table.setModel(model); 課 程 設(shè) 計(jì) 軟件工程與數(shù)據(jù)庫 課程設(shè)計(jì) 任務(wù)書 學(xué)院名稱: 數(shù)學(xué)與計(jì)算機(jī)學(xué)院 課程代碼:_6014419_ 專 業(yè): 年 級(jí): 一、設(shè)計(jì)題目 圖書管理系統(tǒng) 二、主要內(nèi)容 一個(gè)簡單的圖書管理系統(tǒng)包括圖書館內(nèi)書籍的信息、學(xué)校在校學(xué)生的信息以及學(xué)生的借閱信息。此系統(tǒng)功能分為面向?qū)W生和面向管理員兩部分,其中學(xué)生可以進(jìn)行借閱、續(xù)借、歸還和查詢書籍等操作,管理員可以完成書籍和學(xué)生的增加,刪除和修改以及對(duì)學(xué)生,借閱、續(xù)借、歸還的確認(rèn)。如: 圖書室有各種圖書一萬多冊(cè)。 每種圖書都有書名、書號(hào)(ISBN)、一名或多名作者(譯者)、出版社、定價(jià)和內(nèi)容簡介。 借書證記錄有借閱者的姓名、所在單位、職業(yè)等。 憑借書證借書,每次最多能借8本書。借書期限最長為30天。實(shí)現(xiàn)新進(jìn)圖書的數(shù)據(jù)錄入。 實(shí)現(xiàn)對(duì)所有購進(jìn)圖書的分類查詢和分類統(tǒng)計(jì)。能夠按書名、作者等分類查詢現(xiàn)有圖書的數(shù)量。 記錄借閱者的個(gè)人資料和所借圖書的書名、書號(hào)數(shù)據(jù)等。 三、具體要求 1、完成系統(tǒng)的需求分析 通過需求分析確定系統(tǒng)需要處理的數(shù)據(jù)的需求,要求使用數(shù)據(jù)庫的輔助設(shè)計(jì)工具(PowerDesigner等),建立業(yè)務(wù)處理模型。 課 程 設(shè) 計(jì) 2、完成系統(tǒng)概念結(jié)構(gòu)設(shè)計(jì) 概念數(shù)據(jù)模型(CDM)用于完成數(shù)據(jù)庫的設(shè)計(jì),與人和數(shù)據(jù)庫平臺(tái)和具體數(shù)據(jù)存儲(chǔ)結(jié)構(gòu)和工具無關(guān)。首先選擇局部應(yīng)用畫出分E-R圖,最終形成系統(tǒng)的E-R圖 3、完成系統(tǒng)邏輯結(jié)構(gòu)設(shè)計(jì) 按照E-R圖轉(zhuǎn)換成關(guān)系模式的規(guī)則,將CDM轉(zhuǎn)換成邏輯數(shù)據(jù)模型,并為每個(gè)關(guān)系模式設(shè)計(jì)主鍵、外鍵。分析關(guān)系模式中的依賴關(guān)系,對(duì)關(guān)系模式規(guī)范化處理 4、完成系統(tǒng)物理結(jié)構(gòu)設(shè)計(jì) 為每個(gè)關(guān)系分配存儲(chǔ)長度,建立數(shù)據(jù)庫的索引和視圖,定義關(guān)系中的主碼和外碼,寫出關(guān)系創(chuàng)建和查詢的SQL語句。 5、編碼 選擇你自己熟悉的開發(fā)工具完成一個(gè)DBS系統(tǒng)的編碼工作。源代碼格式規(guī)范,注釋不少于三分之一 四、主要技術(shù)路線提示 1.仔細(xì)閱讀設(shè)計(jì)指導(dǎo)書內(nèi)容,認(rèn)真掌握任務(wù)要求?2.需求分析? 3.概念結(jié)構(gòu)設(shè)計(jì)? 4.邏輯結(jié)構(gòu)設(shè)計(jì)?5.物理結(jié)構(gòu)設(shè)計(jì)?6.編碼.2.后臺(tái)推薦采用SQL server或Oracle;前臺(tái)開發(fā)環(huán)境不限制。可采用ADO,ODBC,OLE DB或JDBC連接數(shù)據(jù)庫,并調(diào)用系統(tǒng)存儲(chǔ)過程、自定義存儲(chǔ)過程、函數(shù)等。 五、進(jìn)度安排 第1周: 數(shù)據(jù)庫系統(tǒng)概念模型、數(shù)據(jù)模型設(shè)計(jì),創(chuàng)建數(shù)據(jù)庫以及相關(guān)對(duì)象; 第2周: 前臺(tái)程序開發(fā),撰寫報(bào)告,接受檢查。 六、完成后應(yīng)上交的材料 1. 源程序一份(包含數(shù)據(jù)庫) 2. 課程設(shè)計(jì)報(bào)告一份 七、推薦參考資料 1.王珊.數(shù)據(jù)庫系統(tǒng)概論(第四版).高等教育出版社 2.閃四清.數(shù)據(jù)庫系統(tǒng)原理與應(yīng)用教程.清華大學(xué)出版社 課 程 設(shè) 計(jì) 3.周龍?bào)J.數(shù)據(jù)庫管理系統(tǒng)實(shí)現(xiàn)技術(shù).中國地質(zhì)大學(xué)出版社 4.張海藩.軟件工程概論.清華大學(xué)出版社 5.陳明 編著.實(shí)用軟件工程基礎(chǔ).清華大學(xué)出版社 6.成先海.數(shù)據(jù)庫基礎(chǔ)與應(yīng)用-SQL SERVER2000.機(jī)械工業(yè)出版社出版 指導(dǎo)教師 簽名日期 年 月 日 系 主 任 審核日期 年 月 日第五篇:數(shù)據(jù)庫課程設(shè)計(jì) 圖書管理系統(tǒng)(精選)