《转》jsp+mysql实例简单的购物车
标签:
jspweb购物车mysql |
分类: 开发 |
jsp+mysql实例简单的购物车
该项目数据库用MySQL对数据的管理,有两个表,一个表是cart另一个是shop。小练习拿出来分享希望对大家有用
1
cart表
http://s5/mw690/001On4Dlzy6NiFymgPaf4&690
shop表
2
index.jsp
http://s4/mw690/001On4Dlzy6NiFOKzUnc3&690
http://s15/mw690/001On4Dlzy6NiFONHZ4ee&690
buy.jsp
http://s9/mw690/001On4Dlzy6NiGcdtMc38&690
http://s10/mw690/001On4Dlzy6NiGcdpQB39&690
http://s10/mw690/001On4Dlzy6NiGci3Dr89&690
http://s4/mw690/001On4Dlzy6NiGclunhf3&690
http://s16/mw690/001On4Dlzy6NiGolmPl5f&690
http://s2/mw690/001On4Dlzy6NiGomyYNd1&690
http://s11/mw690/001On4Dlzy6NiGonCwqfa&690
3
http://s11/mw690/001On4Dlzy6NiGtfL7Aaa&690
http://s7/mw690/001On4Dlzy6NiGtfjb816&690
数据库中内容随之更新:
http://s4/mw690/001On4Dlzy6NiGtgDNpa3&690
遇到问题:
问题1:
Stacktrace:] with root cause
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
原因:
代码中输入密码与MySQL中的真正密码不一致,导致登陆失败
解决:
把代码中“password=root”的root改为实际数据库的密码。
问题2:
Stacktrace:] with root cause
com.mysql.jdbc.exceptions.MySQLIntegrityConstraint
解决方法:
把主键设为自动增长
http://s6/mw690/001On4Dlzy6NiGtivuld5&690
参考程序原作《http://blog.csdn.net/myserverthepeople/article/details/7981300》

加载中…