Code Monkey home page Code Monkey logo

customermanagement's Introduction

JavaWeb项目之客户管理系统

项目介绍

详细讲解请点击这里前往我的博客客户管理系统项目

功能介绍

  • 添加客户:添加客户的信息,包括姓名,性别,手机,邮箱,自我描述
  • 查询客户:查询数据库中所有的客户,查询结果将客户信息以列表的形式给出,可以对列表中的客户信息进行编辑及删除
  • 高级搜索:多条件组合在数据库中进行客户信息的查询,搜索结果以列表的形式给出,可以对列表中的客户信息进行编辑及删除
  • 新增分页功能,逻辑很强。

运用知识

  • 数据库基本查询
  • 数据库连接池c3p0
  • 运用dbutil.jar包一键封装表单数据到bean对象中
  • 利用dbutils.jar包简化对数据库增、删、改、查的代码
  • 标签库
  • JavaWeb三层框架的分离
  • 将servlet的转发、重定向及方法进行封装,这样当设计到多个功能时不用建立多个servlet类。
  • 反射

准备

1.导入第三方jar包以及c3p0配置文件。

  • c3p0.jar
  • mchange-commons.java.jar
  • commons-beanutils.jar
  • commons-dbutils.jar
  • commons-logging.jar
  • 自己写的小工具itcast-tools.jar
  • jstl.jar
  • mysql-connector-java.jar

2.建包

  • dao
  • service
  • servlet
  • domain

搭建环境

IntelliJ IDEA + MySQL 或者 eclipse + MySQL

使用方法

  1. git clone https://github.com/codingXiaxw/CustomerManagement.git
  2. 使用IntelliJ IDEA导入打开 或者 使用eclipse打开CustomerManagement_for_Eclipse项目
  3. 使用eclipse/src/create_table.sql文件中的sql语句创建相应的数据库及表
  4. 修改CustomerManagement/srcc3p0-config.xml中数据库相关信息
  5. 部署Tomcat并启动
  6. enjoy it

项目功能截图

添加客户

查询客户

编辑客户

高级搜索客户

新增分页后的界面

customermanagement's People

Contributors

codingxiaxw avatar comecu avatar doucr avatar gitchql avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

customermanagement's Issues

查询客户 编辑项 可能存在问题

编辑后无论男女都显示 女。
可能问题如下:edt.jsp 32行

<input type="radio" name="gender" value="male" id="male" <c:if test="${customer.gender eq 'male'}"/>checked="checked"/>

<input type="radio" name="gender" value="female" id="female" <c:if test="${customer.gender eq 'female'}"/> checked="checked"/>

改为
<input type="radio" name="gender" value="male" id="male" <c:if test="${customer.gender eq 'male'}">checked="checked"</c:if>/>

<input type="radio" name="gender" value="female" id="female" <c:if test="${customer.gender eq 'female'}">checked="checked"</c:if> />

后正常,
谷歌浏览器 ,win764位。

关于servlet的转发、重定向

感谢您的分享,我才刚开始接触servlet,关于您将servlet的转发、重定向及方法进行封装这里,我源代码看的不是很清晰,是在BaseServlet将servlet的转发、重定向及方法进行封装的么?是否是根据jsp的名字来跳转到子类servlet的相应方法,但是这里子类servlet的方法都报黄色警告说没有被用到,所以提交表单的操作会抛出异常,因为我刚接触并且我也是用的mac+IDEA开发,一些配置我都还没有弄懂。所以还希望能够指正一些我的错误,谢谢。

snip20170210_20
Uploading Snip20170210_24.png…

cp30这个包报错

29-Sep-2017 11:38:30.215 WARNING [C3P0PooledConnectionPoolManager[identityToken->8lf1qf9q1kitqc11p55jv7|609fb345]-HelperThread-#1] com.mchange.v2.resourcepool.BasicResourcePool. com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@543ddc65 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3421) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1247) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775) at com.mysql.jdbc.Connection.<init>(Connection.java:1555) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
Hello!最近拿你的代码练手。添加客户的时候,连接出现了问题。不知道从何入手解决。
配置都没有任何问题的,因为在的Demo里数据是可以成功插入的,可到了servlet就连接不上了,

给以后使用这个项目的同学提个醒

c3p0-config.xml 文件要做下面的修改(因为版本的问题)
jdbc:mysql://localhost:3306/customer?serverTimezone=UTC
com.mysql.cj.jdbc.Driver
然后修改自己的密码就可以了

依赖包

请问你自己写的那个itcast包在哪里可以找到?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.