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宠物医院---安装的更多相关文章

  1. Eclipse Spring Tool Suite插件安装

    目录 Eclipse Spring Tool Suite插件安装 Eclipse Spring Tool Suite插件安装 1.登录网址:http://spring.io/tools/sts/all ...

  2. Eclipse的Spring IDE插件的安装和使用

    Spring IDE是Spring官方网站推荐的Eclipse插件,可提供在研发Spring时对Bean定义文件进行验证并以可视化的方式查看各个Bean之间的依赖关系等. 安装 使用Eclipse M ...

  3. 1. Spring 简介以及关于 Eclipse 的 Spring Tool Suite 插件安装

    今天开始学 Spring 了,就先来认识一下什么是 Spring 吧. 1. 首先,Spring 是一个框架,而且是开源的. 2. Spring 为简化企业级应用开发而生.使用 Spring 可以使简 ...

  4. Spring的下载与安装

    Spring是一个独立的框架,不依赖于任何Web服务器或容器.它既可在独立的JavaSE项目中使用,也可以在Java Web项目中使用. 下载和安装Spring框架可按如下步骤进行: 1.登录http ...

  5. Eclipse 下Spring cloud项目集成开发插件Spring Tool Suite (STS) 安装

    安装eclipse插件 Help->Eclipse Marketplace-> Search中查找"Spring Tool Suite (STS) for Eclipse&quo ...

  6. Spring Tool Suite(STS)安装

    Spring Tool Suite是一个基于Eclipse的开发环境,可以自定义用于开发Spring应用程序.它提供了一个随时可用的环境来实现,调试,运行和部署Spring应用程序,包括Pivotal ...

  7. Spring Boot环境的安装

    Eclipse 使用springboot框架 环境的安装 1.下载java1.8 ,安装并配置环境变量 环境变量增加java 的安装目录到环境变量中path中增加 %JAVA_HOME%/bin增加变 ...

  8. 【转】Spring 的下载、安装和使用

    一.下载 Spring 下载地址:http://repo.spring.io/libs-release-local/org/springframework/spring/4.0.6.RELEASE/  ...

  9. Spring 的下载、安装和使用

    一.下载 Spring 下载地址:http://repo.spring.io/libs-release-local/org/springframework/spring/4.0.6.RELEASE/  ...

随机推荐

  1. Jquery 回到顶部

    转:http://www.cnblogs.com/DemoLee/archive/2012/04/20/2459082.html 用jQuery实现渐隐渐显的返回顶部效果(附多图)   先来看几个图片 ...

  2. javascript获取鼠标位置

    首先不同浏览器中event位置属性的分析: 1. IE的event.x,event.y是以事件触发元素的父元素外界为参考点(不包括滚动距离) 2. Firefox的event.pageX,event. ...

  3. memcache 存储session

    php使用memcache存储session   http://blog.csdn.net/weilee2009/article/details/7658260

  4. Explain的type, where 和 order by 组合是索引的选择

    Explain的type显示的是访问类型,是较为重要的一个指标,结果值从好到坏依次是: system > const > eq_ref > ref > fulltext > ...

  5. Helpers\Tags

    Helpers\Tags The tags helper is a collection of useful methods: Tags::clean($data) Clean function to ...

  6. 如何使用Linux命令dhclient

    如何使用Linux命令 dhclient The Internet Systems Consortium DHCP Client, dhclient, provides a means for con ...

  7. 给jdk写注释系列之jdk1.6容器(13)-总结篇之Java集合与数据结构

         是的,这篇blogs是一个总结篇,最开始的时候我提到过,对于java容器或集合的学习也可以看做是对数据结构的学习与应用.在前面我们分析了很多的java容器,也接触了好多种常用的数据结构,今天 ...

  8. WIN2003服务器IIS下如何开启GZIP压缩

    在上一篇文章黑客流谈到了关于网页打开速度对SEO的影响,其中提到了网页开启Gzip压缩的好处,接下来我来和大家分享一下WINDOWS系统IIS服务器下如何开启Gzip压缩. 首先我们来了解一下什么是G ...

  9. HDU 4433 locker

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4433 这是一道2012年ACM天津赛区现场赛的题目,大意是给出两串数字,求用最少的转换次数将一串(A) ...

  10. 理解Android系统的进程间通信原理(二)----RPC机制

    理解Android系统中的轻量级解决方案RPC的原理,需要先回顾一下JAVA中的RMI(Remote Method Invocation)这个易于使用的纯JAVA方案(用来实现分布式应用).有关RMI ...