配置文件如下
SQL文件内容:
/*
Navicat MySQL Data Transfer
Source Server : zou
Source Server Version : 50096
Source Host : localhost:3306
Source Database : commodity_sys
Target Server Type : MYSQL
Target Server Version : 50096
File Encoding : 65001
Date: 2018-11-13 17:46:54
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `items`
-- ----------------------------
DROP TABLE IF EXISTS `items`;
CREATE TABLE `items` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(32) NOT NULL COMMENT '商品名称',
`price` float(10,1) NOT NULL COMMENT '商品定价',
`detail` text COMMENT '商品描述',
`pic` varchar(64) default NULL COMMENT '商品图片',
`createtime` datetime NOT NULL COMMENT '生产日期',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of items
-- ----------------------------
INSERT INTO `items` VALUES ('6', '测试', '10.0', '图片上传测试', '127abc49-2672-4103-b435-f0abdfe9af64.png', '2018-03-31 00:00:00');
INSERT INTO `items` VALUES ('7', '测试', '12.0', '测试', '9ad09b30-190b-4421-b32e-ff6e9441661a.png', '2018-02-28 00:00:00');
INSERT INTO `items` VALUES ('8', '测试', '10.0', '测试', 'cb6d513e-d19a-4f3d-8604-dc45cd0068ab.png', '2018-04-01 00:00:00');
INSERT INTO `items` VALUES ('9', '图片修改测试', '22.0', '图片修改测试', 'b2bb9363-668c-4570-914b-a5754c06b63a.jpg', '2018-04-24 00:00:00');
INSERT INTO `items` VALUES ('10', '测试', '12.0', '大四的', '6f403062-2156-4062-b4cb-6e67d2bde1f1.jpg', '2018-04-01 00:00:00');
INSERT INTO `items` VALUES ('13', '阿达的', '55.0', '打', '6961a62a-9461-4a3f-bdbf-569f11be2f2c.jpg', '2018-04-01 00:00:00');
INSERT INTO `items` VALUES ('15', '图片显示测试', '13.0', '图片显示测试', '4185bc11-48a7-4034-ad1e-79a238bb7f49.jpg', '2018-04-24 00:00:00');
INSERT INTO `items` VALUES ('16', '测试', '150.0', '彩色', 'a1283254-7285-4da3-85cd-3f7cd9f5d729.jpg', '2018-04-24 00:00:00');
INSERT INTO `items` VALUES ('17', 'dasdasd', '11.0', '大四的', '6492fc91-09fa-45d2-b0e0-9363cdc2cafa.jpg', '2018-04-24 00:00:00');
INSERT INTO `items` VALUES ('18', '的', '416.0', '安顺', 'b70b4aa3-b3fd-4581-88df-8d67b9667aae.jpg', '2018-04-24 00:00:00');
-- ----------------------------
-- Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(32) NOT NULL COMMENT '用户名称',
`password` varchar(32) NOT NULL COMMENT '密码',
`birthday` date default NULL COMMENT '注册日期',
`sex` char(1) default NULL COMMENT '性别,"男"“女”',
`address` varchar(256) default NULL COMMENT '地址',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'admin', '123456', '2018-03-31', '1', '贵州贵阳');
INSERT INTO `user` VALUES ('2', 'qxb', '123456', '2018-04-01', '1', '美国纽约市');
appllicationContext.xml
SpringMvc.xml
mybatis-config.xml
db.properties:
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/commodity_sys?useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=123456
log4j.properties:
# Global logging configuration
#\u5728\u5f00\u53d1\u73af\u5883\u4e0b\u65e5\u5fd7\u7ea7\u522b\u8981\u8bbe\u7f6e\u6210DEBUG\uff0c\u751f\u4ea7\u73af\u5883\u8bbe\u7f6e\u6210info\u6216error
log4j.rootLogger=DEBUG, stdout
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
#4 mybatis \u663E\u793ASQL\u8BED\u53E5\u90E8\u5206
log4j.logger.org.mybatis=DEBUG
#log4j.logger.cn.tibet.cas.dao=DEBUG
#log4j.logger.org.mybatis.common.jdbc.SimpleDataSource=DEBUG#
#log4j.logger.org.mybatis.common.jdbc.ScriptRunner=DEBUG#
#log4j.logger.org.mybatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG#
#log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.ResultSet=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
d