欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOCX文档下载  

    图书管理系统数据库源代码.docx

    • 资源ID:3377749       资源大小:43.73KB        全文页数:21页
    • 资源格式: DOCX        下载积分:6.99金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要6.99金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    图书管理系统数据库源代码.docx

    图书管理系统数据库源代码图书管理系统数据库源代码 /创建工程及设计主界面 public class Main extends JFrame private static final JDesktopPane DESKTOP_PANE=new JDesktopPane; /桌面窗体 public static void main(String args) /入口方法 try UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName); /设置系统界面外观 new BookLogin; /登录窗口 catch(Exception ex) ex.printStackTrace; public static void addIFame(JInternalFrame iframe) /添加子窗体的方法 DESKTOP_PANE.add(iframe); /新增子窗体 public Main super; /设置“关闭”按钮处理事件 setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); /创建工具栏 Toolkit tool=Toolkit,getDefaultToolkit; /获得屏幕大小 Dimension screenSize=tool.getScreenSize; setSize(800,600); /设置窗体大小 setLocation(screenSize.width-getWidth)/2,(screenSize.height-getHeight)/2; /设置窗体位置 setTitle("图书管理系统"); /设置窗体标题 JMenuBar menuBar=createMenu; /创建菜单栏 setJMenuBar(menuBar); /设置菜单栏 JToolBar toolBar=createToolBar; /创建工具栏的方法 getContentPane,add(toolBar,BorderLayout.NORTH); /设置工具栏 final JLable lable=new JLable; /创建一个标签,用来显示图片 lable.setBounds(0,0,0,0); /设置窗体的大小和位置 lable.setIcon(null); /窗体背景 DESKTOP_PANE.addComponentListener(new ComponentAdapter) public void componentResized(final ComponentEvent e) Dimension size=e.getComponent.getSize; /获得组建大小 lable.setSize(e.getComponent.getSize); /设置标签大小 lable.setText("<html><img width="+size.width+"height="+size.height+"src='"+this.getClass.getResource("/backImg.jpg")+"'></html>"); /设置标签文本,设置窗口背景 /将标签添加到桌面窗体 DESKTOP_PANE.add(lable,new Integer(Integer.MIN_VALUE); getContentPane.add(DESKTOP_PANE); /将桌面窗体添加到主窗体中 private JToolBar createToolBar /创建工具栏的方法 JToolBar toolBar=new JToolBar; /初始化工具栏 toolBar.setFloatable(false); /设置是否可以移动工具栏 toolBar.setBorder(new BevelBorder(BevelBorder.RAIZED); /设置边框 /图书信息添加按钮 JButton bookAddButton=new JButton(MenuActions.BOOK_ADD); ImageIcon icon=new ImageIcon(Main.class.getResource("/bookAddtb.jpg"); /添加菜单栏图标 bookAddButton.setIcon(icon); /设置按钮图标 bookAddButton.setHideActionText(true); /显示提示文本 toolBar.add(bookAddButton); /添加到工具栏中 JButton bookModiAndDelButton=new JButton(MenuActions.BOOK_MODIFY); /图书信息修改按钮 ImageIcon bookmodiicon=Icon.add("bookModiAndDeltb.jpg"); /创建图表方法 bookModiAndDelButton.setIcon(bookmodiicon); /设置按钮图标 bookModiAndDelButton.setHideActionText(true); /显示提示文本 toolBar.add(bookModiAndDelButton); /添加到工具栏 JButton bookTypeAddButton=new JButton(MenuActions.BOOKTYPE_ADD); /图书类别添加按钮 ImageIcon bookTypeAddicon=Icon.add("bookTypeAddtb.jpg"); /创建图标方法 bookTypeAddButton.setIcon(bookTypeAddicon); /设置按钮图标 bookTypeAddButton.setHideActionText(true); /显示提示文本 toolBar.add(bookTypeAddButton); /添加到工具栏 JButton bookBorrowButton=new JButton(MenuActions.BORROW); /图书借阅按钮 ImageIcon bookBorrowicon=Icon.add("bookBorrowtb.jpg"); /创建图标方法 bookBorrowButton.setIcon(bookBorrowicon); /设置按钮图标 bookBorrowButton.setHideActionText(true); /显示提示文本 toolBar.add(bookBorrowButton); /添加到工具栏 JButton bookOrderButton=new JButton(MenuActions.NEWBOOK_ORDER); /新书订购按钮 ImageIcon bookOrdericon=Icon.add("bookOrdertb.jpg"); /创建图标方法 bookOrderButton.setIcon(bookOrdericon); /设置按钮图标 bookOrderButton.setHideActionText(true); /显示提示文本 toolBar.add(bookOrderButton); /添加到工具栏 JButton bookCheckButton=new JButton(MenuActions.NEWBOOK_CHECK); /验收新书按钮 ImageIcon bookCheckicon=Icon.add("newbookChecktb.jpg"); /创建图标方法 bookCheckButton.setIcon(bookCheckicon); /设置按钮图标 bookCheckButton.setHideActionText(true); /显示提示文本 toolBar.add(bookCheckButton); /添加到工具栏 JButton readerAddButton=new JButton(MenuActions.READER_ADD); /读者信息添加按钮 ImageIcon readerAddicon=Icon.add("readerAddtb.jpg"); /创建图标方法 readerAddButton.setIcon(readerAddicon); /设置按钮图标 readerAddButton.setHideActionText(true); /显示提示文本 toolBar.add(readerAddButton); /添加到工具栏 JButton readerModiAndDelButton=new JButton(MenuActions.READER_MODIFY); /读者信息修改按钮 ImageIcon readerModiAndDelicon=Icon.add("readerModiAndDeltb.jpg"); /创建图标方法 readerModiAndDelButton.setIcon(readerModiAndDelicon); /设置按钮图标 readerModiAndDelButton.setHideActionText(true); /显示提示文本 toolBar.add(readerModiAndDelButton); /添加到工具栏 JButton ExitButton=new JButton(MenuActions.EXIT); /退出系统按钮 ImageIcon Exiticon=Icon.add("exittb.jpg"); /创建图标方法 ExitButton.setIcon(Exiticon); /设置按钮图标 ExitButton.setHideActionText(true); /显示提示文本 toolBar.add(ExitButton); /添加到工具栏 return toolBar; public class Business protected static String dbClassName="com.mysql.jdbc.Driver" /数据库驱动类 protected static String dbUr1="jdbc:mysql:/localhost/ts" /连接URL protected static String dbUser="root" /数据库用户名 protected static String dbpwd="root" /数据库密码 private static Connection conn=null; /数据库连接对象,初值为null public Business try if(coon=null) /连接对象为空 Class.forName(dbClassName); /加载驱动类信息 conn=DriverManager.getConnection(dbUr1,dbUser,dbPwd); /建立连接对象 catch(Exception ee) ee.printStackTrace; public static ResultSet executeQuery(String sql) /执行查询方法 try /如果连接对象为空,则重新调用构造方法 if (conn=null) new Business; return conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE).executeQuery(sql); /执行查询 catch(SQLException e) e.printStackTrace; return null; /返回null值 finally public static int executeUpdata(String sql) /更新方法 try if(conn=null) new Business; /如果连接对象为空,则重新调用构造方法 return conn.createStatement.executeUpdate(sql); /执行更新 catch(SQLException e) e.printStackTrace; return -1; finally public static void close /关闭方法 try conn.close; /关闭连接对象 catch(SQLException e) e.printStackTrace; finally conn=null; /设置连接对象为null值 /为数据库添加对应的类 public class BookInfo private String Book_id; /图书编号 private String typeid; /类别编号 private String writer; /作者 private String translator; /译者 private String publisher; /出版社 private Date date; /出版日期 private Double price; /图书单价 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; /图书类别编号 private String typeName; /图书类别名称 private String days; /可解天数 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; /图书编号 private Date date; /下单时间 private String number; /图书数量 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; /操作员编号 private String name; /操作员用户名 private String grade; /操作员等级 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; /借阅编号 private String book_id; /图书编号 private String reader_id; /读者编号 private String num; /借书数量 private String borrowDate; /借书日期 private String backDate; /应还日期 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; /图书编号 private String bookname; /图书名称 private String operatorId; /操作员编号 private String borrowDate; /图书借阅时间 private String backDate; /图书归还时间 private String readerName; /读者姓名 private String reader_id; /读者编号 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; /系统登录模块设计 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; /创建布局管理器 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); /设置“关闭”按钮处理事件 borderLayout.setVgap(10); /设置组件间的垂直关系 getContentPane.setLayout(borderLayout); /使用布局管理器 setTitle("图书管理系统登录") /设置窗体标题 Toolkit tool=Toolkit.getDefaultToolkit; /获得默认的工具箱 Dimension screenSize=tool.getScreenSize; /获得屏幕的大小 setSize(285,194); setLocation(screenSize.width-getWidth)/2,(screenSize.height-getHeight)/2); /设置窗体位置 final JPanel mainPanel=new JPanel; /创建主面板 mainPanel.setLayout(new BorderLayout); /设置边框布局 mainPanel.setBorder(new EmptyBorder(0,0,0,0) /设置边框为0 getContentPane.add(mainPanel); /在窗体中加入主面板 final JLabel imageLabel=new JLabel; /创建一个标签,用来显示图片 ImageIcon loginIcon=Icon.add("login.jpg"); /创建一个图像图标 imagelabel.setIcon(loginIcon); /设置图片 imageLabel.setOpaque(true); /设置绘制其边界内的所有像素 imageLabel.setBackground(Color.GREEN); /设置背景颜色 imageLabel.setpreferredSize(new Dimension(260,60); /设置标签大小 mainPanel.add(imageLabel,BorderLayout.NORTH); /添加标签到主面板 final JPanel centerPanel=new JPanel; /添加一个中心面板 final GridLayout gridLayout=new GridLayout(2,2); /创建网络布局管理器 gridLayout.setHgap(5); /设置组件之间平行的距离 gridLayout.setVgap(20); /设置组件之间垂直的距离 centerPanel.setLayout(gridLayout); /使用布局管理器 mainPanel.add(centerPanel); /添加到主桌面 final JLabel userNamelabel=new JLabel; /创建一个标签 userNameLabel.setHorizontalAlignment(SwingConstants.CENTER); /设置对齐方式 userNameLabel.setPreferredSize(new Dimension(0,0); /设置组件大小 userNameLabel.setMinimumSize(new Dimension(0,0); /设置组件最小的大小 centerPanel.add(userNameLabel); /添

    注意事项

    本文(图书管理系统数据库源代码.docx)为本站会员(牧羊曲112)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开