码迷,mamicode.com
首页 > 编程语言 > 详细

Spring PecClinic宠物医院---安装

时间:2015-08-03 01:10:14      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:

1、下载源代码

如果本地安装了Git工具,可以直接使用命令

git clone https://github.com/spring-projects/spring-petclinic.git

如果没有Git工具,需要到https://github.com/spring-projects/spring-petclinic下载源码包

2、将petclinic工程导入Eclipse

3、petclinic默认使用HsqlDB,我本地只有Mysql数据库,因此需要配置数据库链接信息,具体有以下两个地方

(1)修改pom.xml,去掉对Mysql的依赖项目的注释

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>

(2)修改data-access.properties

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/happycardata?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
jdbc.username=root
jdbc.password=123456

# Properties that control the population of schema and data for a new data source
jdbc.initLocation=classpath:db/mysql/initDB.sql
jdbc.dataLocation=classpath:db/mysql/populateDB.sql

# Property that determines which Hibernate dialect to use
# (only applied with "applicationContext-hibernate.xml")
hibernate.dialect=org.hibernate.dialect.MySQLDialect

# Property that determines which database to use with an AbstractJpaVendorAdapter
jpa.database=MYSQL
jpa.showSql=true

3、对整个工程进行Maven install,确保install执行成功

4、启动tomcat,访问http://localhost:8080/petclinic/

这时候应该可以看到两只活泼可爱的小狗狗了

技术分享


 

宠物医院业务上设计比较简单,主要有三个角色:宠物pets、医生veterinarians、主人owner。

主要的关系有两个:

(1)一个主人可以拥有多个宠物

(2)一个主人可以多次问诊记录

Spring PecClinic宠物医院---安装

标签:

原文地址:http://www.cnblogs.com/mingziday/p/4697162.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!