网上商城中购物车代码实现,插入中文有乱码,可以做为jsp增删改查mysql的入门实例
项目截图
运行截图
http://localhost/background/index.jsp
登录页面
添加商品页面
查询商品页面
修改商品页面
mysql建库脚本/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50509
Source Host : localhost:3306
Source Database : mydb
Target Server Type : MYSQL
Target Server Version : 50509
File Encoding : 65001
Date: 2017-06-08 16:47:55
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `product`
-- ----------------------------
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`proid` int(11) NOT NULL AUTO_INCREMENT,
`proName` varchar(1000) DEFAULT NULL,
`proprice` varchar(1000) DEFAULT NULL,
`propicture` varchar(255) DEFAULT NULL,
PRIMARY KEY (`proid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of product
-- ----------------------------
INSERT INTO `product` VALUES ('1', 'zuidaima', '111.0', 'http://static.zuidaima.com/images/1/201706/20170608151703660.png');
INSERT INTO `product` VALUES ('2', 'æ代ç ', '111.0', 'http://static.zuidaima.com/images/1/201706/20170608151703660.png');
-- ----------------------------
-- Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uname` varchar(1000) DEFAULT NULL,
`upass` varchar(1000) DEFAULT NULL,
`sex` int(2) DEFAULT NULL,
`favs` varchar(100) DEFAULT NULL,
`city` varchar(100) DEFAULT NULL,
`jianjie` varchar(5000) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES ('1', 'zuidaima', '111111', '1', '111', '11', 'zuidaima.com');