本文为大家分享了LibrarySystem图书管理系统开发的第一篇,供大家参考,具体内容如下
SSM搭建过程:
一般idea创建工程的过程
打开idea ---> File ---> new ---> project ---> maven --->
create from archetype ---> maven-archetype-webapp ---> 接下来一般默认即可
最后在main目录下新建java 和 resources 文件夹。
第一步:添加Spring、Spring MVC、Mybatis的依赖
都配有详细的说明,这里不再重复
pom.xml
4.0.0 com.ray LibrarySystem021.0-SNAPSHOT war LibrarySystem02 Maven Webapp http://www.example.com UTF-8 1.7 1.7 1.1.1 5.1.18 1.1.9 3.4.1 1.3.0 3.1.0 4.3.2.RELEASE 1.7.18 1.2.17 1.9.13 2.9.2 1.2.47 1.3.5 junit junit4.11 test ch.qos.logback logback-classic${logback.version} mysql mysql-connector-java${mysql.version} runtime com.alibaba druid${com.alibaba.druid.version} org.mybatis mybatis${com.mybatis.mybatis.version} org.mybatis mybatis-spring${com.mybatis.mybatis_spring.version} jstl jstl1.2 javax.servlet javax.servlet-api${javax.servlet.version} org.springframework spring-core${org.springframework.version} org.springframework spring-beans${org.springframework.version} org.springframework spring-context${org.springframework.version} org.springframework spring-jdbc${org.springframework.version} org.springframework spring-tx${org.springframework.version} org.springframework spring-web${org.springframework.version} org.springframework spring-webmvc${org.springframework.version} org.springframework spring-test${org.springframework.version} org.codehaus.jackson jackson-mapper-asl${jackson-mapper-asl.version} com.fasterxml.jackson.core jackson-core${jackson.version} com.fasterxml.jackson.core jackson-databind${jackson.version} com.alibaba fastjson${fastjson.version} LibrarySystem02 maven-clean-plugin 3.0.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.7.0 maven-surefire-plugin 2.20.1 maven-war-plugin 3.2.0 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2 org.mybatis.generator mybatis-generator-maven-plugin${org.mybatis.generator.version} true true org.mybatis mybatis${com.mybatis.mybatis.version} mysql mysql-connector-java${mysql.version}
第二步:添加数据库
这里需要创建一个数据库,名为:library
建表语句如下:
# Host: localhost (Version 6.0.11-alpha-community) # Date: 2018-05-22 20:31:40 # Generator: MySQL-Front 6.0 (Build 2.20) # # Structure for table "book" # DROP TABLE IF EXISTS `book`; CREATE TABLE `book` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `book_name` varchar(255) NOT NULL, `book_writer` varchar(255) NOT NULL, `book_publisher` varchar(255) NOT NULL, `book_isrent` bigint(20) NOT NULL, `book_person` varchar(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; # # Data for table "book" # INSERT INTO `book` VALUES (1,'机器学习','周志华','清华大学出版社',1,'linyue'),(2,'实战机器学习','Peter','人民邮电出版社',1,'linyue'),(4,'算法导论','Thomas','机械工业出版社',0,' '); # # Structure for table "user" # DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` bigint(11) NOT NULL AUTO_INCREMENT, `user_name` varchar(40) NOT NULL, `user_email` varchar(50) NOT NULL, `user_pwd` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; # # Data for table "user" # INSERT INTO `user` VALUES (1,'linyue','123123@qq.com','123'),(3,'rain','222222@gmail.com','222'),(4,'ray','333333@qq.com','333'),(5,'test','123123@qq.com','123');
完整项目demo下载:LibrarySystem02
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



